novacloud22-cli 1.0.4 → 1.0.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.
- package/index.js +10 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -183,8 +183,16 @@ program
|
|
|
183
183
|
const res = await axios.get(`${SITES_API}/p/my-sites`, { headers })
|
|
184
184
|
sites = res.data.sites || []
|
|
185
185
|
spinner.stop()
|
|
186
|
-
} catch {
|
|
186
|
+
} catch (e) {
|
|
187
187
|
spinner.stop()
|
|
188
|
+
if (e.response?.status === 401) {
|
|
189
|
+
console.log(chalk.red('\n ✗ Session expired. Please log in again: novacloud22 login\n'))
|
|
190
|
+
process.exit(1)
|
|
191
|
+
}
|
|
192
|
+
const msg = e.response?.data?.detail || e.message
|
|
193
|
+
console.log(chalk.red(`\n ✗ Failed to fetch sites: ${msg}`))
|
|
194
|
+
console.log(chalk.gray(' Make sure you are connected to the internet.\n'))
|
|
195
|
+
process.exit(1)
|
|
188
196
|
}
|
|
189
197
|
|
|
190
198
|
if (sites.length === 0) {
|
|
@@ -476,7 +484,7 @@ program
|
|
|
476
484
|
|
|
477
485
|
program
|
|
478
486
|
.name('novacloud22')
|
|
479
|
-
.version('1.0.
|
|
487
|
+
.version('1.0.5')
|
|
480
488
|
.description('NovaCloud22 CLI — Deploy static sites')
|
|
481
489
|
|
|
482
490
|
program.parse(process.argv)
|