@zsukim/ctv-run 1.0.13 β†’ 1.0.14

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.
@@ -116,9 +116,7 @@ function runFireTv() {
116
116
  console.log('πŸ”„ Force stopping existing process...');
117
117
  (0, child_process_1.execSync)(`${adbBin} -s ${tvIp}:5555 shell am force-stop ${pkg}`);
118
118
  // μ‹€ν–‰ μ»€λ§¨λ“œ μž‘μ„±
119
- const fullActivityPath = activity.startsWith('.')
120
- ? `${pkg}/${activity}`
121
- : activity;
119
+ const fullActivityPath = buildActivityComponent(pkg, activity);
122
120
  let launchCmd = `${adbBin} -s ${tvIp}:5555 shell am start -n ${fullActivityPath}`;
123
121
  // Live Mode일 λ•Œλ§Œ URL μ£Όμž…
124
122
  if (!targetArg) {
@@ -138,3 +136,15 @@ function runFireTv() {
138
136
  }
139
137
  });
140
138
  }
139
+ function buildActivityComponent(pkg, activity) {
140
+ const trimmed = (activity || '').trim();
141
+ if (!trimmed)
142
+ return `${pkg}/.MainActivity`;
143
+ if (trimmed.includes('/'))
144
+ return trimmed;
145
+ if (trimmed.startsWith('.'))
146
+ return `${pkg}/${trimmed}`;
147
+ if (trimmed.includes('.'))
148
+ return `${pkg}/${trimmed}`;
149
+ return `${pkg}/.${trimmed}`;
150
+ }
@@ -254,6 +254,21 @@ function ensureTizenFiles(appId_1, tempDir_1, appName_1) {
254
254
  if (found) {
255
255
  fs_extra_1.default.copyFileSync(found, destConfigXml);
256
256
  console.log(`πŸ“ config.xml 볡사: ${found}`);
257
+ // config.xmlμ—μ„œ μ°Έμ‘°ν•˜λŠ” 에셋 νŒŒμΌμ„ 같은 λ””λ ‰ν† λ¦¬μ—μ„œ 볡사
258
+ try {
259
+ const xmlContent = fs_extra_1.default.readFileSync(found, 'utf8');
260
+ const sourceDir = path_1.default.dirname(found);
261
+ const srcMatches = [...xmlContent.matchAll(/src="([^"]+\.(?:png|jpg|jpeg|gif|svg|webp|ico|bmp))"/gi)];
262
+ for (const match of srcMatches) {
263
+ const srcFile = path_1.default.join(sourceDir, match[1]);
264
+ const destFile = path_1.default.join(tempDir, match[1]);
265
+ if (fs_extra_1.default.existsSync(srcFile) && !fs_extra_1.default.existsSync(destFile)) {
266
+ fs_extra_1.default.copyFileSync(srcFile, destFile);
267
+ console.log(`πŸ“Ž 에셋 볡사: ${match[1]}`);
268
+ }
269
+ }
270
+ }
271
+ catch (_a) { }
257
272
  }
258
273
  else {
259
274
  console.log(`πŸ“ config.xml 생성 쀑... (Name: ${appName}, ID: ${appId})`);
@@ -150,6 +150,24 @@ function ensureWebosAppInfo(appId, tempDir, specifiedPath) {
150
150
  for (const candidate of candidates) {
151
151
  if (fs_extra_1.default.existsSync(candidate)) {
152
152
  fs_extra_1.default.copySync(candidate, destPath);
153
+ // appinfo.jsonμ—μ„œ μ°Έμ‘°ν•˜λŠ” 에셋 νŒŒμΌμ„ 같은 λ””λ ‰ν† λ¦¬μ—μ„œ 볡사
154
+ try {
155
+ const appInfo = fs_extra_1.default.readJsonSync(candidate);
156
+ const sourceDir = path_1.default.dirname(candidate);
157
+ const assetFields = ['icon', 'largeIcon', 'splashBackground'];
158
+ for (const field of assetFields) {
159
+ const val = appInfo[field];
160
+ if (typeof val === 'string' && val) {
161
+ const srcAsset = path_1.default.join(sourceDir, val);
162
+ const destAsset = path_1.default.join(tempDir, val);
163
+ if (fs_extra_1.default.existsSync(srcAsset) && !fs_extra_1.default.existsSync(destAsset)) {
164
+ fs_extra_1.default.copyFileSync(srcAsset, destAsset);
165
+ console.log(`πŸ“Ž 에셋 볡사: ${val}`);
166
+ }
167
+ }
168
+ }
169
+ }
170
+ catch (_a) { }
153
171
  return;
154
172
  }
155
173
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zsukim/ctv-run",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "Smart TV deployment CLI for Vizio, LG webOS, Fire TV, and Samsung Tizen",
5
5
  "keywords": [
6
6
  "ctv",