aircon 0.2.0 → 0.2.2
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 +21 -7
- 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: d76315d35b51587153fc8df9ef838132d3c3e86a0c3e4c2cd8a0316efae9c69a
|
|
4
|
+
data.tar.gz: c563bde8c95b8fe48de22520b014a3b98a6b0cd81974b6ced35b1aa600e4c4b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d951bf39261652772719424735e55cbab79ed819e2fb36347b6e93d61c4c6c534660c64eaa578f68480e46b689e0c37737ff6841dca58e5375dd2af8d492c55f
|
|
7
|
+
data.tar.gz: 8d331471642fc173bd1f770559e0c8a55a773517089082378918b8144fc1220f2b43cc779f9305da896ebaf3dc5e2abdb76492e15a0e20512616a95d051ff8e7
|
data/lib/aircon/commands/up.rb
CHANGED
|
@@ -170,18 +170,32 @@ 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
|
-
|
|
173
|
+
checkout_branch(container, branch)
|
|
174
|
+
|
|
175
|
+
# 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.
|
|
176
|
+
system("docker", "exec", container, "git", "config", "--global", "url.\"https://github.com/anthropics/\".insteadOf", "ssh://git@github.com/anthropics/")
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def checkout_branch(container, branch)
|
|
180
|
+
current_branch, = Open3.capture2("docker", "exec", container, "git", "rev-parse", "--abbrev-ref", "HEAD")
|
|
181
|
+
return if current_branch.strip == branch
|
|
182
|
+
|
|
183
|
+
_, local_status = Open3.capture2("docker", "exec", container, "git", "rev-parse", "--verify", branch)
|
|
184
|
+
if local_status.success?
|
|
185
|
+
system("docker", "exec", container, "git", "checkout", "-f", branch)
|
|
186
|
+
elsif branch_exists_on_remote?(container, branch)
|
|
176
187
|
system("docker", "exec", container, "git", "fetch", "origin", branch)
|
|
177
|
-
system("docker", "exec", container, "git", "checkout", "-b", branch, "origin/#{branch}")
|
|
188
|
+
system("docker", "exec", container, "git", "checkout", "-f", "-b", branch, "origin/#{branch}")
|
|
178
189
|
else
|
|
179
190
|
system("docker", "exec", container, "git", "fetch", "origin", "main")
|
|
180
|
-
system("docker", "exec", container, "git", "checkout", "-b", branch, "origin/main")
|
|
191
|
+
system("docker", "exec", container, "git", "checkout", "-f", "--no-track", "-b", branch, "origin/main")
|
|
181
192
|
end
|
|
193
|
+
system("docker", "exec", container, "git", "clean", "-fd")
|
|
194
|
+
end
|
|
182
195
|
|
|
183
|
-
|
|
184
|
-
|
|
196
|
+
def branch_exists_on_remote?(container, branch)
|
|
197
|
+
output, status = Open3.capture2("docker", "exec", container, "git", "ls-remote", "--heads", "origin", branch)
|
|
198
|
+
status.success? && !output.strip.empty?
|
|
185
199
|
end
|
|
186
200
|
|
|
187
201
|
def run_init_script(container)
|
data/lib/aircon/version.rb
CHANGED