ic-mops 0.8.0 → 0.8.2
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/.gitignore +2 -0
- package/README.md +1 -1
- package/cli.js +9 -8
- package/commands/template.js +1 -0
- package/commands/upgrade.js +2 -2
- package/package.json +5 -1
package/.gitignore
ADDED
package/README.md
CHANGED
package/cli.js
CHANGED
|
@@ -17,7 +17,7 @@ import {add} from './commands/add.js';
|
|
|
17
17
|
import {cacheSize, cleanCache} from './cache.js';
|
|
18
18
|
import {test} from './commands/test.js';
|
|
19
19
|
import {template} from './commands/template.js';
|
|
20
|
-
|
|
20
|
+
import {upgrade} from './commands/upgrade.js';
|
|
21
21
|
|
|
22
22
|
let cwd = process.cwd();
|
|
23
23
|
let configFile = path.join(cwd, 'mops.toml');
|
|
@@ -171,12 +171,13 @@ program
|
|
|
171
171
|
await template(options);
|
|
172
172
|
});
|
|
173
173
|
|
|
174
|
-
//
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
174
|
+
// upgrade
|
|
175
|
+
program
|
|
176
|
+
.command('self-update')
|
|
177
|
+
.description('Upgrade mops CLI to the latest version')
|
|
178
|
+
.option('--detached')
|
|
179
|
+
.action(async (options) => {
|
|
180
|
+
upgrade(options);
|
|
181
|
+
});
|
|
181
182
|
|
|
182
183
|
program.parse();
|
package/commands/template.js
CHANGED
|
@@ -22,6 +22,7 @@ export async function template() {
|
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
let mopsTestYml = new URL('../templates/mops-test.yml', import.meta.url);
|
|
25
|
+
fs.mkdirSync(path.resolve(process.cwd(), '.github/workflows'), {recursive: true});
|
|
25
26
|
fs.copyFileSync(mopsTestYml, dest);
|
|
26
27
|
console.log(chalk.green('Workflow created:'), dest);
|
|
27
28
|
}
|
package/commands/upgrade.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import child_process from 'child_process';
|
|
2
2
|
|
|
3
|
-
export function upgrade() {
|
|
3
|
+
export function upgrade({detached = false} = {}) {
|
|
4
4
|
console.log('Upgrading mops CLI...');
|
|
5
|
-
child_process.execSync('npm i ic-mops -g', {stdio: 'inherit'});
|
|
5
|
+
child_process.execSync('npm i ic-mops -g', {stdio: 'inherit', detached});
|
|
6
6
|
}
|
package/package.json
CHANGED