@ghl-ai/aw 0.1.6 → 0.1.8
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/commands/init.mjs +1 -1
- package/commands/pull.mjs +19 -1
- package/package.json +1 -1
package/commands/init.mjs
CHANGED
|
@@ -84,7 +84,7 @@ function installAutoSync() {
|
|
|
84
84
|
profiles.push(join(HOME, '.bashrc'));
|
|
85
85
|
|
|
86
86
|
const marker = '# aw-auto-sync';
|
|
87
|
-
const snippet = `\n${marker}\n[ -f "$HOME/.aw_registry/.sync-config.json" ] && command -v aw >/dev/null 2>&1 && aw pull --silent &\n`;
|
|
87
|
+
const snippet = `\n${marker}\n[ -f "$HOME/.aw_registry/.sync-config.json" ] && command -v aw >/dev/null 2>&1 && (cd "$HOME" && aw pull --silent) &\n`;
|
|
88
88
|
|
|
89
89
|
const target = profiles.find(p => existsSync(p)) || join(HOME, '.zshrc');
|
|
90
90
|
const current = existsSync(target) ? readFileSync(target, 'utf8') : '';
|
package/commands/pull.mjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { mkdirSync, existsSync, readdirSync } from 'node:fs';
|
|
4
4
|
import { join } from 'node:path';
|
|
5
|
+
import { homedir } from 'node:os';
|
|
5
6
|
import { execSync } from 'node:child_process';
|
|
6
7
|
import * as config from '../config.mjs';
|
|
7
8
|
import * as fmt from '../fmt.mjs';
|
|
@@ -19,11 +20,28 @@ import { generateCommands, copyInstructions } from '../integrate.mjs';
|
|
|
19
20
|
export function pullCommand(args) {
|
|
20
21
|
const input = args._positional?.[0] || '';
|
|
21
22
|
const cwd = process.cwd();
|
|
22
|
-
const
|
|
23
|
+
const GLOBAL_AW_DIR = join(homedir(), '.aw_registry');
|
|
24
|
+
const localDir = join(cwd, '.aw_registry');
|
|
25
|
+
const workspaceDir = args._workspaceDir || (existsSync(join(localDir, '.sync-config.json')) ? localDir : GLOBAL_AW_DIR);
|
|
23
26
|
const dryRun = args['--dry-run'] === true;
|
|
24
27
|
const verbose = args['-v'] === true || args['--verbose'] === true;
|
|
28
|
+
const silent = args['--silent'] === true || args._silent === true;
|
|
25
29
|
const renameNamespace = args._renameNamespace || null;
|
|
26
30
|
|
|
31
|
+
// Silent mode: suppress all output and exit cleanly on errors
|
|
32
|
+
if (silent) {
|
|
33
|
+
const origCancel = fmt.cancel;
|
|
34
|
+
fmt.cancel = () => { process.exit(0); };
|
|
35
|
+
fmt.logInfo = () => {};
|
|
36
|
+
fmt.logSuccess = () => {};
|
|
37
|
+
fmt.logStep = () => {};
|
|
38
|
+
fmt.logWarn = () => {};
|
|
39
|
+
fmt.logMessage = () => {};
|
|
40
|
+
fmt.note = () => {};
|
|
41
|
+
fmt.outro = () => {};
|
|
42
|
+
fmt.spinner = () => ({ start: () => {}, stop: () => {} });
|
|
43
|
+
}
|
|
44
|
+
|
|
27
45
|
// No args = re-pull everything in sync config
|
|
28
46
|
if (!input) {
|
|
29
47
|
const cfg = config.load(workspaceDir);
|