moontraze 2.0.1 → 2.0.4
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/bin/moontraze.js +18 -11
- package/package.json +2 -1
package/bin/moontraze.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const { Command } = require('commander');
|
|
3
3
|
const chalk = require('chalk');
|
|
4
|
-
const path = require('path');
|
|
5
4
|
const { login } = require('../lib/auth');
|
|
6
|
-
const {
|
|
5
|
+
const {
|
|
6
|
+
getConfig,
|
|
7
|
+
getProject,
|
|
8
|
+
setProject,
|
|
9
|
+
GLOBAL_FILE,
|
|
10
|
+
} = require('../lib/config');
|
|
7
11
|
const { deploy } = require('../lib/deploy');
|
|
8
12
|
const { selfUpdate, INSTALL_DIR } = require('../lib/selfUpdate');
|
|
9
13
|
const { uninstall } = require('../lib/uninstall');
|
|
@@ -13,11 +17,12 @@ const program = new Command();
|
|
|
13
17
|
|
|
14
18
|
// Moon CLI se aata hai
|
|
15
19
|
const platformName = process.env.MOON_PLATFORM || 'moontraze';
|
|
16
|
-
const apiUrl =
|
|
17
|
-
|
|
20
|
+
const apiUrl =
|
|
21
|
+
process.env.MOON_API || getConfig().apiUrl || 'https://api.moontraze.com';
|
|
22
|
+
const domain =
|
|
23
|
+
process.env.MOON_DOMAIN || getConfig().domain || 'moontraze.com';
|
|
18
24
|
|
|
19
|
-
|
|
20
|
-
let version = '1.0.6';
|
|
25
|
+
let version = '2.0.1';
|
|
21
26
|
try {
|
|
22
27
|
version = require('../package.json').version || version;
|
|
23
28
|
} catch (_) {}
|
|
@@ -115,13 +120,17 @@ program
|
|
|
115
120
|
.option('-y, --yes', 'Confirm uninstall')
|
|
116
121
|
.action((opts) => {
|
|
117
122
|
if (!opts.yes) {
|
|
118
|
-
console.log(
|
|
123
|
+
console.log(
|
|
124
|
+
chalk.yellow(
|
|
125
|
+
'This will remove Moontraze CLI and local data from your system.'
|
|
126
|
+
)
|
|
127
|
+
);
|
|
119
128
|
console.log(chalk.gray(` Target: ${MOONTRAZE_HOME}`));
|
|
120
129
|
console.log(chalk.gray(' Also removes old ~/.moontraze if present.'));
|
|
121
130
|
console.log(chalk.gray(' Global Moon CLI is NOT deleted.'));
|
|
122
131
|
console.log('');
|
|
123
132
|
console.log(chalk.cyan('Run: moon moontraze uninstall --yes'));
|
|
124
|
-
console.log(chalk.cyan('
|
|
133
|
+
console.log(chalk.cyan(' or: npx moontraze uninstall --yes'));
|
|
125
134
|
process.exit(0);
|
|
126
135
|
}
|
|
127
136
|
try {
|
|
@@ -160,7 +169,7 @@ program
|
|
|
160
169
|
.option('--production', 'Deploy to production')
|
|
161
170
|
.option('-p, --project <name>', 'Project name')
|
|
162
171
|
.action(async (opts, cmd) => {
|
|
163
|
-
if (cmd.args
|
|
172
|
+
if (cmd.args && cmd.args.length) return;
|
|
164
173
|
if (opts.prod || opts.production || opts.project) {
|
|
165
174
|
await runDeploy(opts);
|
|
166
175
|
} else {
|
|
@@ -178,10 +187,8 @@ Examples:
|
|
|
178
187
|
moon ${platformName} deploy --prod
|
|
179
188
|
moon ${platformName} update
|
|
180
189
|
moon ${platformName} uninstall --yes
|
|
181
|
-
moon ${platformName} --prod
|
|
182
190
|
npx moontraze login
|
|
183
191
|
npx moontraze deploy --prod
|
|
184
|
-
npx moontraze uninstall --yes
|
|
185
192
|
`
|
|
186
193
|
);
|
|
187
194
|
|