ota-manager 1.0.0 → 1.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.
Files changed (2) hide show
  1. package/lib/ota-main.js +24 -7
  2. package/package.json +4 -2
package/lib/ota-main.js CHANGED
@@ -30,7 +30,7 @@ function showHelp() {
30
30
  ║ Version ${TOOL_VERSION} ║
31
31
  ╚════════════════════════════════════════════════════════════╝
32
32
 
33
- Usage: npx ota-updates <command> [sub-command] [version]
33
+ Usage: npx ota-manager <command> [sub-command] [version]
34
34
 
35
35
  Management Commands:
36
36
  list : Show all registered infrastructures.
@@ -42,8 +42,8 @@ Management Commands:
42
42
 
43
43
  Operational Commands:
44
44
  status : Check local vs remote version.
45
- training : Deploy update to TRAINING channel.
46
- live : Deploy update to LIVE channel.
45
+ deploy training : Deploy update to TRAINING channel.
46
+ deploy live : Deploy update to LIVE channel.
47
47
 
48
48
  Active Infrastructure:
49
49
  Strategy : ${OTA_CONFIG.strategy.toUpperCase()}
@@ -166,16 +166,33 @@ async function run() {
166
166
  process.exit(0);
167
167
  break;
168
168
 
169
+ case '-d':
169
170
  case 'deploy':
170
171
  if (!subArg) {
171
- console.log('❌ Error: Mohon tentukan channel (training/live).');
172
+ console.log('❌ Error: Mohon tentukan channel (e.g., deploy training atau deploy live).');
172
173
  process.exit(1);
173
174
  }
174
-
175
+ const channel = subArg.toLowerCase();
176
+ if (channel !== 'training' && channel !== 'live') {
177
+ console.log(`❌ Error: Channel "${channel}" tidak dikenal. Gunakan 'training' atau 'live'.`);
178
+ process.exit(1);
179
+ }
180
+
181
+ execSync(`node "${scripts.version}"`, { stdio: 'inherit' });
175
182
  execSync(`node "${scripts.verify}"`, { stdio: 'inherit' });
176
183
 
177
- if (await confirm(`Deploy to ${subArg.toUpperCase()}?`)) {
178
- execSync(`node "${scripts.deploy}" ${subArg} ${versionArg || ''}`, { stdio: 'inherit' });
184
+ if (channel === 'training') {
185
+ console.log(`\n📋 DEPLOYMENT PLAN [TRAINING]`);
186
+ console.log(`🔹 Infra : ${OTA_CONFIG.strategy.toUpperCase()}`);
187
+ console.log(`🔹 Action : Build & Push to Training Channel`);
188
+ } else {
189
+ console.log(`\n🚨 WARNING: DEPLOYMENT KE LIVE [PRODUCTION]`);
190
+ console.log(`🔹 Infra : ${OTA_CONFIG.strategy.toUpperCase()}`);
191
+ console.log(`🔹 Action : Build & Push to LIVE Channel`);
192
+ }
193
+
194
+ if (await confirm(`Proceed with ${channel.toUpperCase()} deployment?`)) {
195
+ execSync(`node "${scripts.deploy}" ${channel} ${versionArg || ''}`, { stdio: 'inherit' });
179
196
  } else {
180
197
  console.log('❌ Deployment cancelled.');
181
198
  }
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "ota-manager",
3
- "version": "1.0.0",
3
+ "version": "1.0.4",
4
4
  "description": "Multi-provider OTA update manager for Astro and static web projects.",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "bin": {
8
+ "ota-manager": "bin/cli.js",
8
9
  "ota-updates": "bin/cli.js"
9
10
  },
10
11
  "scripts": {
@@ -33,7 +34,8 @@
33
34
  },
34
35
  "homepage": "https://github.com/firstryan/ota-manager#readme",
35
36
  "dependencies": {
36
- "archiver": "^8.0.0"
37
+ "archiver": "^8.0.0",
38
+ "ota-manager": "^1.0.1"
37
39
  },
38
40
  "engines": {
39
41
  "node": ">=18.0.0"