ic-mops 0.3.7 → 0.4.0

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.
package/cli.js CHANGED
@@ -14,6 +14,7 @@ import {whoami} from './commands/whoami.js';
14
14
  import {installAll} from './commands/install-all.js';
15
15
  import {search} from './commands/search.js';
16
16
  import {add} from './commands/add.js';
17
+ import {upgrade} from './commands/upgrade.js';
17
18
 
18
19
  let cwd = process.cwd();
19
20
  let configFile = path.join(cwd, 'mops.toml');
@@ -124,10 +125,17 @@ program
124
125
  // search
125
126
  program
126
127
  .command('search <text>')
127
- .alias('find')
128
128
  .description('Search for packages')
129
129
  .action(async (text) => {
130
130
  await search(text);
131
131
  });
132
132
 
133
+ // search
134
+ program
135
+ .command('upgrade')
136
+ .description('Upgrade mops CLI to the latest version')
137
+ .action(async () => {
138
+ upgrade();
139
+ });
140
+
133
141
  program.parse();
@@ -0,0 +1,6 @@
1
+ import child_process from 'child_process';
2
+
3
+ export function upgrade() {
4
+ console.log('Upgrading mops CLI...');
5
+ child_process.execSync('npm i ic-mops -g', {stdio: 'inherit'});
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "0.3.7",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mops": "cli.js"