@zalom/plastic 1.0.0-alpha.2 → 1.0.0-alpha.3
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/install.rb +10 -3
package/package.json
CHANGED
package/scripts/install.rb
CHANGED
|
@@ -141,13 +141,18 @@ def distribute(mode)
|
|
|
141
141
|
puts " \u{1f4e6} #{mode == :update ? "Updating" : "Installing"} core files to #{PLASTIC_HOME}"
|
|
142
142
|
|
|
143
143
|
FileUtils.mkdir_p(PLASTIC_HOME)
|
|
144
|
-
FileUtils.mkdir_p(File.join(PLASTIC_HOME, "scripts"))
|
|
144
|
+
FileUtils.mkdir_p(File.join(PLASTIC_HOME, "scripts", "lib"))
|
|
145
145
|
|
|
146
146
|
core_files = {
|
|
147
147
|
"PLASTIC.md" => "PLASTIC.md",
|
|
148
148
|
"deprecations.yml" => "deprecations.yml",
|
|
149
149
|
"scripts/folgezettel-id" => "scripts/folgezettel-id",
|
|
150
150
|
"scripts/read-config" => "scripts/read-config",
|
|
151
|
+
"scripts/hook-session-start" => "scripts/hook-session-start",
|
|
152
|
+
"scripts/hook-continue" => "scripts/hook-continue",
|
|
153
|
+
"scripts/hook-future-intent-check" => "scripts/hook-future-intent-check",
|
|
154
|
+
"scripts/hook-gate-check" => "scripts/hook-gate-check",
|
|
155
|
+
"scripts/lib/bridge.rb" => "scripts/lib/bridge.rb",
|
|
151
156
|
}
|
|
152
157
|
|
|
153
158
|
core_files.each do |src, dest|
|
|
@@ -239,7 +244,7 @@ def install_claude(config, force)
|
|
|
239
244
|
|
|
240
245
|
installed = []
|
|
241
246
|
|
|
242
|
-
# Copy hooks
|
|
247
|
+
# Copy hooks, rewriting script paths for the installed location
|
|
243
248
|
hook_source = File.join(PACKAGE_ROOT, "hooks")
|
|
244
249
|
Dir.glob(File.join(hook_source, "*")).each do |f|
|
|
245
250
|
next unless File.file?(f)
|
|
@@ -247,7 +252,9 @@ def install_claude(config, force)
|
|
|
247
252
|
next if %w[hooks.json run-hook].include?(basename)
|
|
248
253
|
dest_name = basename.start_with?("plastic-") ? basename : "plastic-#{basename}"
|
|
249
254
|
dest = File.join(hooks_dir, dest_name)
|
|
250
|
-
|
|
255
|
+
content = File.read(f)
|
|
256
|
+
content = content.gsub('$SCRIPT_DIR/../scripts/', '$HOME/.plastic/scripts/')
|
|
257
|
+
File.write(dest, content)
|
|
251
258
|
FileUtils.chmod(0o755, dest)
|
|
252
259
|
installed << dest
|
|
253
260
|
end
|