aircon 0.2.0 → 0.2.1
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.
- checksums.yaml +4 -4
- data/lib/aircon/commands/up.rb +14 -8
- data/lib/aircon/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b5b3b124b494117995209a018929128c6f19659813c182d8cf204a29b695bc97
|
|
4
|
+
data.tar.gz: ffd8e8323e460a77a007abe18f43cee07080b78156da9759fd3f22773310860c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 749d093f93485cbbc99b3280be49d8921049b5ad107ccc17170f6522d47eefe358bde6ba17afa74c270d289133feb47673486a4dc28e39f8f42fa614e9f9f5b4
|
|
7
|
+
data.tar.gz: '091c7ce2565eea7113f4c3d8263a0c31a72349e5c05ff681f373bd0c9e40b82feda3f031f507a5ec74304e40161891d98034f1a6b8167616f2dc031a03b41676'
|
data/lib/aircon/commands/up.rb
CHANGED
|
@@ -170,14 +170,20 @@ module Aircon
|
|
|
170
170
|
system("docker", "exec", container, "git", "config", "--global",
|
|
171
171
|
"url.#{authed}.insteadOf", "git@github.com:")
|
|
172
172
|
end
|
|
173
|
-
#
|
|
174
|
-
|
|
175
|
-
if
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
173
|
+
# Skip checkout if already on the target branch (host was on this branch)
|
|
174
|
+
current_branch, = Open3.capture2("docker", "exec", container, "git", "rev-parse", "--abbrev-ref", "HEAD")
|
|
175
|
+
if current_branch.strip != branch
|
|
176
|
+
# Check if branch exists on remote; if so, check it out, otherwise create new
|
|
177
|
+
_, status = Open3.capture2("docker", "exec", container, "git", "ls-remote", "--heads", "origin", branch)
|
|
178
|
+
if status.success? && !_.strip.empty?
|
|
179
|
+
system("docker", "exec", container, "git", "fetch", "origin", branch)
|
|
180
|
+
system("docker", "exec", container, "git", "checkout", "-f", "-b", branch, "origin/#{branch}")
|
|
181
|
+
system("docker", "exec", container, "git", "clean", "-fd")
|
|
182
|
+
else
|
|
183
|
+
system("docker", "exec", container, "git", "fetch", "origin", "main")
|
|
184
|
+
system("docker", "exec", container, "git", "checkout", "-f", "--no-track", "-b", branch, "origin/main")
|
|
185
|
+
system("docker", "exec", container, "git", "clean", "-fd")
|
|
186
|
+
end
|
|
181
187
|
end
|
|
182
188
|
|
|
183
189
|
# If you have the official anthropic marketplace plugin installed, it will always make a call to the anthropic github repo on claude startup. It uses SSH, but it should be https for universal compatibility since its a public repository.
|
data/lib/aircon/version.rb
CHANGED