Skip to content
Permalink
Browse files
Fix known options for plugman create
Instead of --plugin_{id,version} we had --platform_{id,version}

As unknown options are always interpreted as Boolean, before this fix
the created plugin.xml always contains <plugin id="true" version="true">

See also #110 (comment)
  • Loading branch information
raphinesse committed Apr 10, 2019
1 parent 6dc057f commit 04cc98fd0595fd55c4b7e3aa197d1ab6a0223bd5
Showing 2 changed files with 5 additions and 5 deletions.
@@ -49,8 +49,8 @@ const known_opts = {
searchpath: [path, Array],
save: Boolean,
name: String,
platform_id: String,
platform_version: String,
plugin_id: String,
plugin_version: String,
plugins_dir: String
};
const shortHands = { var: ['--variable'], v: ['--version'], h: ['--help'] };
@@ -24,10 +24,10 @@ 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']);
const cli_opts = nopt(knownOptions, shortHands, ['plugman', 'create', '--name', 'MyName', '--plugin_id', 'MyId', '--plugin_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');
expect(cli_opts.plugin_id).toEqual('MyId');
expect(cli_opts.plugin_version).toEqual('1.0.0');
});
});

0 comments on commit 04cc98f

Please sign in to comment.