sugarjar 2.0.2 → 3.0.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/CHANGELOG.md +19 -0
- data/README.md +123 -52
- data/bin/sj +80 -19
- data/examples/sample_config.yaml +6 -0
- data/examples/sample_repoconfig.yaml +19 -3
- data/lib/sugarjar/commands/bclean.rb +28 -13
- data/lib/sugarjar/commands/checks.rb +25 -8
- data/lib/sugarjar/commands/debuginfo.rb +1 -1
- data/lib/sugarjar/commands/feature.rb +25 -2
- data/lib/sugarjar/commands/push.rb +1 -1
- data/lib/sugarjar/commands/smartclone.rb +64 -7
- data/lib/sugarjar/commands/smartpullrequest.rb +29 -6
- data/lib/sugarjar/commands/up.rb +42 -10
- data/lib/sugarjar/commands.rb +93 -25
- data/lib/sugarjar/config.rb +33 -4
- data/lib/sugarjar/log.rb +2 -0
- data/lib/sugarjar/util.rb +28 -14
- data/lib/sugarjar/version.rb +1 -1
- metadata +2 -2
data/lib/sugarjar/util.rb
CHANGED
|
@@ -46,16 +46,36 @@ class SugarJar
|
|
|
46
46
|
s
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
-
def self.ghcli_nofail(*
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
def self.ghcli_nofail(*)
|
|
50
|
+
forge_nofail('gh', *)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def self.ghcli(*)
|
|
54
|
+
s = ghcli_nofail(*)
|
|
55
|
+
s.error!
|
|
56
|
+
s
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def self.glcli_nofail(*)
|
|
60
|
+
forge_nofail('glab', *)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def self.glcli(*)
|
|
64
|
+
s = glcli_nofail(*)
|
|
65
|
+
s.error!
|
|
66
|
+
s
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def self.forge_nofail(cli, *args)
|
|
70
|
+
SugarJar::Log.trace("Running: #{cli} #{args.join(' ')}")
|
|
71
|
+
bin = which(cli)
|
|
72
|
+
s = Mixlib::ShellOut.new([bin] + args).run_command
|
|
73
|
+
if s.error? && s.stderr.include?("#{cli} auth")
|
|
54
74
|
SugarJar::Log.info(
|
|
55
|
-
'
|
|
56
|
-
"to force\ngh to authenticate...
|
|
75
|
+
'glab was run but no gitlab token exists. Will run ' +
|
|
76
|
+
'"glab auth login" to force\ngh to authenticate...',
|
|
57
77
|
)
|
|
58
|
-
unless system(
|
|
78
|
+
unless system(bin, 'auth', 'login', '-p', 'ssh')
|
|
59
79
|
SugarJar::Log.fatal(
|
|
60
80
|
'That failed, I will bail out. Hub needs to get a github ' +
|
|
61
81
|
'token. Try running "gh auth login" (will list info about ' +
|
|
@@ -67,12 +87,6 @@ class SugarJar
|
|
|
67
87
|
s
|
|
68
88
|
end
|
|
69
89
|
|
|
70
|
-
def self.ghcli(*)
|
|
71
|
-
s = ghcli_nofail(*)
|
|
72
|
-
s.error!
|
|
73
|
-
s
|
|
74
|
-
end
|
|
75
|
-
|
|
76
90
|
def self.in_repo?
|
|
77
91
|
s = git_nofail('rev-parse', '--is-inside-work-tree')
|
|
78
92
|
!s.error? && s.stdout.strip == 'true'
|
data/lib/sugarjar/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sugarjar
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Phil Dibowitz
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-06-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: deep_merge
|