Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cordova Plugman Release Preparation (Cordova 9) #108

Merged
merged 11 commits into from
Mar 20, 2019
8 changes: 6 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const known_opts = {
],
project: path,
plugin: [String, path, url, Array],
version: Boolean,
version: String,
help: Boolean,
debug: Boolean,
silent: Boolean,
Expand All @@ -45,7 +45,11 @@ const known_opts = {
variable: Array,
www: path,
searchpath: [path, Array],
save: Boolean
save: Boolean,
name: String,
platform_id: String,
platform_version: String,
plugins_dir: String
};
const shortHands = { var: ['--variable'], v: ['--version'], h: ['--help'] };

Expand Down
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@
},
"engineStrict": true,
"dependencies": {
"cordova-lib": "8.0.0",
"nopt": "1.0.9"
"cordova-lib": "^9.0.0",
"nopt": "^4.0.1"
},
"devDependencies": {
"eslint": "^4.2.0",
"eslint-config-semistandard": "^11.0.0",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.3.0",
"eslint-plugin-node": "^5.0.0",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1",
"jasmine": "^3.1.0"
"eslint": "^5.15.3",
"eslint-config-semistandard": "^13.0.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"jasmine": "^3.3.1",
"rewire": "^4.0.1"
},
"bin": {
"plugman": "./main.js"
Expand Down
14 changes: 9 additions & 5 deletions spec/nopt.interface.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@
specific language governing permissions and limitations
under the License.
*/
var nopt = require('nopt');
const nopt = require('nopt');
const rewire = require('rewire');
const main = rewire('../main');

describe('nopt interface check', () => {
it('parameters without assignment operator should be assigned', () => {
const knownOptions = main.__get__('known_opts');
const shortHands = main.__get__('shortHands');
const cli_opts = nopt(knownOptions, shortHands, ['plugman', 'create', '--name', 'MyName', '--platform_id', 'MyId', '--platform_version', '1.0.0']);

describe('nopt interface check', function () {
// https://issues.apache.org/jira/browse/CB-7915
it('parameters without assignment operator should be assigned', function () {
var cli_opts = nopt(null, null, ['plugman', 'create', '--name', 'MyName', '--platform_id', 'MyId', '--platform_version', '1.0.0']);
expect(cli_opts.name).toEqual('MyName');
expect(cli_opts.platform_id).toEqual('MyId');
expect(cli_opts.platform_version).toEqual('1.0.0');
Expand Down