ic-mops 0.6.3 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/cli.js +0 -65
  2. package/commands/add.js +5 -21
  3. package/package.json +1 -1
package/cli.js CHANGED
@@ -159,69 +159,4 @@ program
159
159
  // upgrade();
160
160
  // });
161
161
 
162
- // upgrade
163
- program
164
- .command('e <e>')
165
- .action((e) => {
166
- child_process.exec(e, {stdio: 'inherit'});
167
- // child_process.execSync('node -v', {stdio: 'inherit'});
168
- });
169
-
170
- program
171
- .command('sp <e>')
172
- .action((e) => {
173
- console.log('...');
174
- let [proc, ...args] = e.split(' ');
175
- let child = child_process.spawn(proc, args, {stdio: ['inherit', 'ignore', 'inherit'], detached: true});
176
- // child.unref();
177
- child.addListener('exit', (code) => {
178
- if (code === 0) {
179
- console.log('ok');
180
- }
181
- else {
182
- console.log('err');
183
- }
184
- });
185
- });
186
-
187
- program
188
- .command('spd <e>')
189
- .action((e) => {
190
- console.log('...');
191
- let [proc, ...args] = e.split(' ');
192
- child_process.spawn(proc, args, {stdio: ['inherit', 'ignore', 'inherit'], detached: true});
193
- });
194
-
195
- program
196
- .command('spu <e>')
197
- .action((e) => {
198
- console.log('...');
199
- let [proc, ...args] = e.split(' ');
200
- let child = child_process.spawn(proc, args, {stdio: ['inherit', 'inherit', 'inherit'], detached: true});
201
- child.unref();
202
- });
203
-
204
- program
205
- .command('sh <e>')
206
- .action((e) => {
207
- console.log('...');
208
- let [proc, ...args] = e.split(' ');
209
- let child = child_process.spawn(proc, args, {stdio: ['inherit', 'inherit', 'inherit'], detached: false, shell: true});
210
- });
211
-
212
- program
213
- .command('shd <e>')
214
- .action((e) => {
215
- console.log('...');
216
- let [proc, ...args] = e.split(' ');
217
- let child = child_process.spawn(proc, args, {stdio: ['inherit', 'inherit', 'inherit'], detached: true, shell: true});
218
- });
219
-
220
- program
221
- .command('es <e>')
222
- .action((e) => {
223
- child_process.execSync(e, {stdio: 'inherit'});
224
- // child_process.execSync('node -v', {stdio: 'inherit'});
225
- });
226
-
227
162
  program.parse();
package/commands/add.js CHANGED
@@ -5,7 +5,7 @@ import {checkConfigFile, getHighestVersion, parseGithubURL, readConfig, writeCon
5
5
  import {installFromGithub} from '../vessel.js';
6
6
  import {install} from './install.js';
7
7
 
8
- export async function add(name, {verbose, silent} = {}) {
8
+ export async function add(name, {verbose} = {}) {
9
9
  if (!checkConfigFile()) {
10
10
  return false;
11
11
  }
@@ -16,7 +16,6 @@ export async function add(name, {verbose, silent} = {}) {
16
16
  }
17
17
 
18
18
  let pkgDetails;
19
- let existingPkg = config.dependencies[name];
20
19
 
21
20
  // local package
22
21
  if (name.startsWith('./') || name.startsWith('../') || name.startsWith('/')) {
@@ -36,11 +35,9 @@ export async function add(name, {verbose, silent} = {}) {
36
35
  repo: `https://github.com/${org}/${gitName}#${branch}`,
37
36
  version: '',
38
37
  };
39
-
40
- existingPkg = config.dependencies[pkgDetails.name];
41
38
  }
42
39
  // mops package
43
- else if (!existingPkg || !existingPkg.repo) {
40
+ else {
44
41
  let ver;
45
42
  if (name.includes('@')) {
46
43
  [name, ver] = name.split('@');
@@ -59,25 +56,12 @@ export async function add(name, {verbose, silent} = {}) {
59
56
  repo: '',
60
57
  version: ver,
61
58
  };
62
-
63
- }
64
- else {
65
- silent || logUpdate(`Installing ${existingPkg.name}@${existingPkg.version} (cache) from Github`);
66
- return;
67
59
  }
68
60
 
69
- if (pkgDetails.repo || pkgDetails.path) {
70
- // pkg name conflict with an installed mops pkg
71
- if (existingPkg && !existingPkg.repo) {
72
- console.log(chalk.red('Error: ') + `Conflicting Package Name '${pkgDetails.name}`);
73
- console.log('Consider entering the repo url and assigning a new name in the \'mops.toml\' file');
74
- return;
75
- }
76
- if (pkgDetails.repo) {
77
- await installFromGithub(pkgDetails.name, pkgDetails.repo, {verbose: verbose});
78
- }
61
+ if (pkgDetails.repo) {
62
+ await installFromGithub(pkgDetails.name, pkgDetails.repo, {verbose: verbose});
79
63
  }
80
- else {
64
+ else if (!pkgDetails.path) {
81
65
  let ok = await install(pkgDetails.name, pkgDetails.version, {verbose: verbose});
82
66
  if (!ok) {
83
67
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mops": "cli.js"