@pippit-dev/cli 1.0.30 → 1.0.31
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/checksums.txt +6 -6
- package/cmd/update/update.go +2 -1
- package/cmd/update/update_test.go +3 -2
- package/dist/checksums.txt +6 -6
- package/package.json +1 -1
- package/scripts/skills.js +2 -1
package/checksums.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
0023facaf65dc042d7dd08b285efbd046efd3dd4cebd29f31e3421b919d38bc9 pippit-tool-cli-1.0.31-darwin-amd64.tar.gz
|
|
2
|
+
a6989ce590556924da7a2ceb5d94a8d75f81b459dae5fe016d0d929ae9c31a0f pippit-tool-cli-1.0.31-darwin-arm64.tar.gz
|
|
3
|
+
2ccc7bfb01fc00a0a7c2948abb18eda6da0769c7c1f21bca3db942a1e7b3a0b3 pippit-tool-cli-1.0.31-linux-amd64.tar.gz
|
|
4
|
+
2a6c10aada4090701a97ef8af69ad91abf4d0fda000634c344157487c7895da7 pippit-tool-cli-1.0.31-linux-arm64.tar.gz
|
|
5
|
+
fcf2e3e988952e046e23a4505630d758e7471d6d7125541eba7d5882588b67cb pippit-tool-cli-1.0.31-windows-amd64.zip
|
|
6
|
+
5b9ce586c808866404c3d6e006c9ed359d1d8aecee105ac38e0015b79be78d64 pippit-tool-cli-1.0.31-windows-arm64.zip
|
package/cmd/update/update.go
CHANGED
|
@@ -101,7 +101,8 @@ func installSkills(root string, stderr io.Writer) error {
|
|
|
101
101
|
} else if !info.IsDir() {
|
|
102
102
|
return fmt.Errorf("%s 不是目录", filepath.Join(root, "skills"))
|
|
103
103
|
}
|
|
104
|
-
|
|
104
|
+
// Override inherited npm global mode without changing skills add's -g scope.
|
|
105
|
+
if err := runInherit(stderr, "npx", "--global=false", "-y", "skills", "add", root, "-g", "-y", "--skill", "*"); err != nil {
|
|
105
106
|
return err
|
|
106
107
|
}
|
|
107
108
|
return cleanupLegacyGlobalSkills(defaultGlobalSkillsDir())
|
|
@@ -26,13 +26,14 @@ func TestInstallSkillsInstallsAllBundledSkills(t *testing.T) {
|
|
|
26
26
|
binDir := t.TempDir()
|
|
27
27
|
capturePath := filepath.Join(t.TempDir(), "args.txt")
|
|
28
28
|
npxPath := filepath.Join(binDir, "npx")
|
|
29
|
-
script := "#!/bin/sh\nfor arg in \"$@\"; do printf '%s\\n' \"$arg\"; done > \"$CAPTURE_ARGS\"\n"
|
|
29
|
+
script := "#!/bin/sh\nif [ \"$npm_config_global\" = true ] && [ \"$1\" != --global=false ]; then exit 1; fi\nfor arg in \"$@\"; do printf '%s\\n' \"$arg\"; done > \"$CAPTURE_ARGS\"\n"
|
|
30
30
|
if err := os.WriteFile(npxPath, []byte(script), 0o755); err != nil {
|
|
31
31
|
t.Fatal(err)
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
t.Setenv("PATH", binDir+string(os.PathListSeparator)+os.Getenv("PATH"))
|
|
35
35
|
t.Setenv("CAPTURE_ARGS", capturePath)
|
|
36
|
+
t.Setenv("npm_config_global", "true")
|
|
36
37
|
t.Setenv("HOME", t.TempDir())
|
|
37
38
|
|
|
38
39
|
var stderr bytes.Buffer
|
|
@@ -45,7 +46,7 @@ func TestInstallSkillsInstallsAllBundledSkills(t *testing.T) {
|
|
|
45
46
|
t.Fatal(err)
|
|
46
47
|
}
|
|
47
48
|
got := strings.Split(strings.TrimSpace(string(gotBytes)), "\n")
|
|
48
|
-
want := []string{"-y", "skills", "add", root, "-g", "-y", "--skill", "*"}
|
|
49
|
+
want := []string{"--global=false", "-y", "skills", "add", root, "-g", "-y", "--skill", "*"}
|
|
49
50
|
if strings.Join(got, "\n") != strings.Join(want, "\n") {
|
|
50
51
|
t.Fatalf("npx args mismatch\ngot: %#v\nwant: %#v", got, want)
|
|
51
52
|
}
|
package/dist/checksums.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
0023facaf65dc042d7dd08b285efbd046efd3dd4cebd29f31e3421b919d38bc9 pippit-tool-cli-1.0.31-darwin-amd64.tar.gz
|
|
2
|
+
a6989ce590556924da7a2ceb5d94a8d75f81b459dae5fe016d0d929ae9c31a0f pippit-tool-cli-1.0.31-darwin-arm64.tar.gz
|
|
3
|
+
2ccc7bfb01fc00a0a7c2948abb18eda6da0769c7c1f21bca3db942a1e7b3a0b3 pippit-tool-cli-1.0.31-linux-amd64.tar.gz
|
|
4
|
+
2a6c10aada4090701a97ef8af69ad91abf4d0fda000634c344157487c7895da7 pippit-tool-cli-1.0.31-linux-arm64.tar.gz
|
|
5
|
+
fcf2e3e988952e046e23a4505630d758e7471d6d7125541eba7d5882588b67cb pippit-tool-cli-1.0.31-windows-amd64.zip
|
|
6
|
+
5b9ce586c808866404c3d6e006c9ed359d1d8aecee105ac38e0015b79be78d64 pippit-tool-cli-1.0.31-windows-arm64.zip
|
package/package.json
CHANGED
package/scripts/skills.js
CHANGED
|
@@ -28,7 +28,8 @@ function installSkillsFromRoot(root, opts = {}) {
|
|
|
28
28
|
if (!fs.existsSync(skillsDir)) {
|
|
29
29
|
throw new Error(`skills directory not found: ${skillsDir}`);
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
// Override npm install -g's inherited mode; the later -g belongs to skills.
|
|
32
|
+
run("npx", ["--global=false", "-y", "skills", "add", source, "-g", "-y", "--skill", "*"], {
|
|
32
33
|
timeout: opts.timeout || 120000,
|
|
33
34
|
});
|
|
34
35
|
cleanupLegacyGlobalSkills(opts.globalSkillsDir);
|