@pushary/agent-hooks 0.62.4 → 0.62.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/CHANGELOG.md +17 -0
- package/dist/bin/pushary-clean.js +5 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.62.5
|
|
4
|
+
|
|
5
|
+
### `clean --dry-run` changed things again
|
|
6
|
+
|
|
7
|
+
0.62.4 moved the dry-run guards into their own module and passed the flag in by
|
|
8
|
+
value. That happened at module load, before the flag had been parsed from the
|
|
9
|
+
command line, so every guard was built in live mode and stayed there. A dry run
|
|
10
|
+
stripped the Codex key, rewrote agent configs and removed the plugin directory,
|
|
11
|
+
while printing "would" beside each one.
|
|
12
|
+
|
|
13
|
+
The guards now read the flag when they run rather than when they are built, so
|
|
14
|
+
there is no longer an order in which they can be created too early.
|
|
15
|
+
|
|
16
|
+
If you ran `clean --dry-run` on 0.62.4, treat it as though you ran a real clean:
|
|
17
|
+
re-run `setup` to reconfigure.
|
|
18
|
+
|
|
19
|
+
|
|
3
20
|
## 0.62.4
|
|
4
21
|
|
|
5
22
|
### `pushary clean` crashed partway through on Node 24
|
|
@@ -40,17 +40,17 @@ import { parse as parseTOML, stringify as stringifyTOML } from "smol-toml";
|
|
|
40
40
|
// src/cli/dry-run.ts
|
|
41
41
|
import { execSync } from "child_process";
|
|
42
42
|
import { rmSync, writeFileSync } from "fs";
|
|
43
|
-
var createGuards = (
|
|
43
|
+
var createGuards = (isDryRun, note) => ({
|
|
44
44
|
write: (path, contents) => {
|
|
45
|
-
if (
|
|
45
|
+
if (isDryRun()) return note("rewrite", path);
|
|
46
46
|
writeFileSync(path, contents, "utf-8");
|
|
47
47
|
},
|
|
48
48
|
remove: (path, options = {}) => {
|
|
49
|
-
if (
|
|
49
|
+
if (isDryRun()) return note("remove ", path);
|
|
50
50
|
rmSync(path, { recursive: true, force: options.force ?? false });
|
|
51
51
|
},
|
|
52
52
|
exec: (command, options, describe) => {
|
|
53
|
-
if (
|
|
53
|
+
if (isDryRun()) return note("run ", describe);
|
|
54
54
|
execSync(command, options);
|
|
55
55
|
}
|
|
56
56
|
});
|
|
@@ -100,7 +100,7 @@ var did = (past) => dryRun ? `(would ${past === "cleaned" ? "clean" : past === "
|
|
|
100
100
|
var wouldNote = (action, path) => {
|
|
101
101
|
console.log(` ${dim("would")} ${action} ${path}`);
|
|
102
102
|
};
|
|
103
|
-
var guards = createGuards(dryRun, wouldNote);
|
|
103
|
+
var guards = createGuards(() => dryRun, wouldNote);
|
|
104
104
|
var guardedWrite = (path, contents) => guards.write(path, contents);
|
|
105
105
|
var guardedRemove = (path, options) => guards.remove(path, options);
|
|
106
106
|
var guardedExec = (command, options, describe) => guards.exec(command, options ?? {}, describe);
|