ticlawk 0.1.12 → 0.1.13
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/package.json +1 -1
- package/scripts/postinstall.mjs +6 -1
- package/src/core/config.mjs +12 -4
package/package.json
CHANGED
package/scripts/postinstall.mjs
CHANGED
|
@@ -24,7 +24,12 @@ if (process.env.npm_config_global === 'true') {
|
|
|
24
24
|
const cliScript = join(packageRoot, 'bin', 'ticlawk.mjs');
|
|
25
25
|
const legacyHome = join(homedir(), '.agent-freeway');
|
|
26
26
|
const ticlawkHome = join(homedir(), '.ticlawk');
|
|
27
|
-
|
|
27
|
+
const legacyConfigPath = join(legacyHome, '.config');
|
|
28
|
+
const ticlawkConfigPath = join(ticlawkHome, '.config');
|
|
29
|
+
if (existsSync(legacyConfigPath) && !existsSync(ticlawkConfigPath)) {
|
|
30
|
+
if (existsSync(ticlawkHome)) {
|
|
31
|
+
renameSync(ticlawkHome, `${ticlawkHome}.pre-migration.${Date.now()}`);
|
|
32
|
+
}
|
|
28
33
|
renameSync(legacyHome, ticlawkHome);
|
|
29
34
|
console.log(`ticlawk: migrated ${legacyHome} to ${ticlawkHome}`);
|
|
30
35
|
}
|
package/src/core/config.mjs
CHANGED
|
@@ -16,12 +16,20 @@ import { RUNTIME_DEFINITIONS, normalizeServiceType } from './runtime-registry.mj
|
|
|
16
16
|
const DEFAULT_TICLAWK_HOME = join(homedir(), '.ticlawk');
|
|
17
17
|
const LEGACY_AGENT_FREEWAY_HOME = join(homedir(), '.agent-freeway');
|
|
18
18
|
|
|
19
|
+
function migrateLegacyHomeIfNeeded() {
|
|
20
|
+
const legacyConfigPath = join(LEGACY_AGENT_FREEWAY_HOME, '.config');
|
|
21
|
+
const ticlawkConfigPath = join(DEFAULT_TICLAWK_HOME, '.config');
|
|
22
|
+
if (!existsSync(legacyConfigPath)) return;
|
|
23
|
+
if (existsSync(ticlawkConfigPath)) return;
|
|
24
|
+
if (existsSync(DEFAULT_TICLAWK_HOME)) {
|
|
25
|
+
renameSync(DEFAULT_TICLAWK_HOME, `${DEFAULT_TICLAWK_HOME}.pre-migration.${Date.now()}`);
|
|
26
|
+
}
|
|
27
|
+
renameSync(LEGACY_AGENT_FREEWAY_HOME, DEFAULT_TICLAWK_HOME);
|
|
28
|
+
}
|
|
29
|
+
|
|
19
30
|
function resolveTiclawkHome() {
|
|
20
31
|
if (process.env.TICLAWK_HOME) return process.env.TICLAWK_HOME;
|
|
21
|
-
|
|
22
|
-
renameSync(LEGACY_AGENT_FREEWAY_HOME, DEFAULT_TICLAWK_HOME);
|
|
23
|
-
}
|
|
24
|
-
if (existsSync(DEFAULT_TICLAWK_HOME)) return DEFAULT_TICLAWK_HOME;
|
|
32
|
+
migrateLegacyHomeIfNeeded();
|
|
25
33
|
return DEFAULT_TICLAWK_HOME;
|
|
26
34
|
}
|
|
27
35
|
|