squared 0.7.8 → 0.8.0
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 +47 -19
- data/README.md +38 -35
- data/lib/squared/common/base.rb +0 -1
- data/lib/squared/common/format.rb +5 -14
- data/lib/squared/common/prompt.rb +25 -24
- data/lib/squared/common/shell.rb +11 -11
- data/lib/squared/common/system.rb +9 -19
- data/lib/squared/common/utils.rb +17 -13
- data/lib/squared/config.rb +3 -11
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/application.rb +98 -24
- data/lib/squared/workspace/project/base.rb +73 -60
- data/lib/squared/workspace/project/docker.rb +38 -28
- data/lib/squared/workspace/project/git.rb +141 -52
- data/lib/squared/workspace/project/node.rb +161 -106
- data/lib/squared/workspace/project/python.rb +26 -28
- data/lib/squared/workspace/project/ruby.rb +38 -25
- data/lib/squared/workspace/project/support/class.rb +2 -2
- data/lib/squared/workspace/project/support/optionpartition.rb +7 -10
- data/lib/squared/workspace/project/support/utils.rb +10 -1
- data/lib/squared/workspace/repo.rb +5 -5
- data/lib/squared/workspace/series.rb +10 -2
- metadata +2 -2
|
@@ -105,7 +105,7 @@ module Squared
|
|
|
105
105
|
end
|
|
106
106
|
|
|
107
107
|
def bannerargs
|
|
108
|
-
%i[version dependfile venv].freeze
|
|
108
|
+
%i[version dependfile venv editable].freeze
|
|
109
109
|
end
|
|
110
110
|
|
|
111
111
|
def venv?
|
|
@@ -216,7 +216,7 @@ module Squared
|
|
|
216
216
|
found |= 1
|
|
217
217
|
run(pdm_session('run', val), from: :run)
|
|
218
218
|
else
|
|
219
|
-
raise
|
|
219
|
+
raise message('script', val) if exception?
|
|
220
220
|
|
|
221
221
|
found |= 2
|
|
222
222
|
log.warn "run script \"#{val}\"".subhint('not indexed')
|
|
@@ -265,10 +265,10 @@ module Squared
|
|
|
265
265
|
|
|
266
266
|
format_desc action, flag, 'c/reate?,d/epend?,opts*'
|
|
267
267
|
task flag do |_, args|
|
|
268
|
-
|
|
269
|
-
rm_rf(venv, verbose:
|
|
270
|
-
venv_init if has_value!(
|
|
271
|
-
depend :force,
|
|
268
|
+
opts = args.to_a
|
|
269
|
+
rm_rf(venv, verbose: !silent?)
|
|
270
|
+
venv_init if has_value!(opts, 'c', 'create')
|
|
271
|
+
depend :force, opts if has_value!(opts, 'd', 'depend')
|
|
272
272
|
end
|
|
273
273
|
when :exec
|
|
274
274
|
format_desc action, flag, 'command,args*'
|
|
@@ -391,7 +391,7 @@ module Squared
|
|
|
391
391
|
else 'outdir?,srcdir?'
|
|
392
392
|
end)
|
|
393
393
|
task flag do |_, args|
|
|
394
|
-
|
|
394
|
+
build_ flag, args.to_a
|
|
395
395
|
end
|
|
396
396
|
break if be
|
|
397
397
|
when 'publish'
|
|
@@ -438,9 +438,9 @@ module Squared
|
|
|
438
438
|
if flag
|
|
439
439
|
cmd << case flag
|
|
440
440
|
when :requirement, :target
|
|
441
|
-
quote_option
|
|
441
|
+
quote_option flag, basepath(target)
|
|
442
442
|
else
|
|
443
|
-
shell_option
|
|
443
|
+
shell_option flag
|
|
444
444
|
end
|
|
445
445
|
op = append_pip flag, opts, pipopts(:install)
|
|
446
446
|
op.clear
|
|
@@ -614,7 +614,8 @@ module Squared
|
|
|
614
614
|
op.clear
|
|
615
615
|
when :user, :upgrade
|
|
616
616
|
op.concat(packages)
|
|
617
|
-
|
|
617
|
+
raise ArgumentError, message('no packages listed', hint: flag) if op.empty?
|
|
618
|
+
|
|
618
619
|
op << "--#{flag}"
|
|
619
620
|
op.append
|
|
620
621
|
python_session('-m pip', *op.to_a.drop(1)) if workspace.windows?
|
|
@@ -622,7 +623,7 @@ module Squared
|
|
|
622
623
|
run(banner: banner, from: :install)
|
|
623
624
|
end
|
|
624
625
|
|
|
625
|
-
def
|
|
626
|
+
def build_(flag, opts = [], outdir: nil, srcdir: nil)
|
|
626
627
|
list = case flag
|
|
627
628
|
when :poetry
|
|
628
629
|
cmd = poetry_session 'build'
|
|
@@ -685,7 +686,6 @@ module Squared
|
|
|
685
686
|
run(from: from)
|
|
686
687
|
end
|
|
687
688
|
end
|
|
688
|
-
alias build_ build!
|
|
689
689
|
|
|
690
690
|
def publish(flag, opts = [], test: false)
|
|
691
691
|
list = case flag
|
|
@@ -706,12 +706,9 @@ module Squared
|
|
|
706
706
|
dist = lambda do
|
|
707
707
|
dir = basepath 'dist'
|
|
708
708
|
return dir if dir.directory? && !dir.empty?
|
|
709
|
+
raise message('no source to publish', hint: dir) if dir.exist?
|
|
709
710
|
|
|
710
|
-
|
|
711
|
-
raise_error 'no source to publish', hint: dir
|
|
712
|
-
else
|
|
713
|
-
raise_error Errno::ENOENT, dir, hint: 'publish'
|
|
714
|
-
end
|
|
711
|
+
raise Errno::ENOENT, message(dir, hint: 'publish')
|
|
715
712
|
end
|
|
716
713
|
if test
|
|
717
714
|
if op.arg?('r', flag == :hatch ? 'repo' : 'repository')
|
|
@@ -772,7 +769,7 @@ module Squared
|
|
|
772
769
|
when :install, :uninstall
|
|
773
770
|
op << '.' if installable? && !op.arg?('r', 'requirement')
|
|
774
771
|
else
|
|
775
|
-
|
|
772
|
+
raise ArgumentError, message('no packages listed', hint: flag)
|
|
776
773
|
end
|
|
777
774
|
elsif flag == :install
|
|
778
775
|
op.append_any
|
|
@@ -795,7 +792,8 @@ module Squared
|
|
|
795
792
|
.clear
|
|
796
793
|
when :cache
|
|
797
794
|
op.concat(args)
|
|
798
|
-
|
|
795
|
+
raise message('no subcommand', hint: flag) if op.empty?
|
|
796
|
+
|
|
799
797
|
op << (action = op.shift)
|
|
800
798
|
case action
|
|
801
799
|
when 'dir', 'info', 'purge'
|
|
@@ -803,13 +801,15 @@ module Squared
|
|
|
803
801
|
when 'list', 'remove'
|
|
804
802
|
op.add_first(quote: true)
|
|
805
803
|
else
|
|
806
|
-
|
|
804
|
+
raise ArgumentError, message('unrecognized args', action, hint: flag)
|
|
807
805
|
end
|
|
808
806
|
op.clear
|
|
809
807
|
when :config
|
|
810
808
|
op.concat(args)
|
|
811
|
-
|
|
812
|
-
|
|
809
|
+
raise message('no subcommand', hint: flag) if op.empty?
|
|
810
|
+
|
|
811
|
+
action = op.shift
|
|
812
|
+
op << action
|
|
813
813
|
case action
|
|
814
814
|
when 'list', 'edit', 'debug'
|
|
815
815
|
nil
|
|
@@ -817,7 +817,7 @@ module Squared
|
|
|
817
817
|
op.add_first
|
|
818
818
|
op.add_first(quote: true, expect: true) if action == 'set'
|
|
819
819
|
else
|
|
820
|
-
|
|
820
|
+
raise ArgumentError, message('unrecognized args', action, hint: flag)
|
|
821
821
|
end
|
|
822
822
|
op.clear
|
|
823
823
|
when :hash
|
|
@@ -854,7 +854,7 @@ module Squared
|
|
|
854
854
|
def variable_set(key, *args, **, &blk)
|
|
855
855
|
if block_given?
|
|
856
856
|
case key
|
|
857
|
-
when :dependfile, :
|
|
857
|
+
when :dependfile, :venv
|
|
858
858
|
args = block_args args, &blk
|
|
859
859
|
end
|
|
860
860
|
end
|
|
@@ -871,8 +871,6 @@ module Squared
|
|
|
871
871
|
log.warn "variable_set: @dependfile=#{val}".subhint('not supported')
|
|
872
872
|
end
|
|
873
873
|
end
|
|
874
|
-
when :editable
|
|
875
|
-
editable_set args.first
|
|
876
874
|
when :venv
|
|
877
875
|
@venv = (basepath(*args) unless args.empty? || args.first.nil?)
|
|
878
876
|
else
|
|
@@ -1026,7 +1024,7 @@ module Squared
|
|
|
1026
1024
|
|
|
1027
1025
|
if found
|
|
1028
1026
|
line.chomp!($1) if line =~ /(?<=[\d"'{}\[\]]|true|false)(\s*#.*)$/
|
|
1029
|
-
break if line.match?(/^\s*\[(
|
|
1027
|
+
break if line.match?(/^\s*\[([\w.\-"' ]+|".+"|'.+')\]\s*$/)
|
|
1030
1028
|
|
|
1031
1029
|
if ch
|
|
1032
1030
|
val = line.rstrip
|
|
@@ -1130,7 +1128,7 @@ module Squared
|
|
|
1130
1128
|
end
|
|
1131
1129
|
|
|
1132
1130
|
def variables
|
|
1133
|
-
(super + %i[venv
|
|
1131
|
+
(super + %i[venv]).freeze
|
|
1134
1132
|
end
|
|
1135
1133
|
|
|
1136
1134
|
def runenv
|
|
@@ -382,7 +382,7 @@ module Squared
|
|
|
382
382
|
if val.include?('*')
|
|
383
383
|
out.concat(Dir.glob(val, base: path))
|
|
384
384
|
elsif !(file = basepath!(val))
|
|
385
|
-
print_error(
|
|
385
|
+
print_error('file not found', hint: val)
|
|
386
386
|
elsif file.directory?
|
|
387
387
|
out.concat(file.glob('**/*.rb'))
|
|
388
388
|
else
|
|
@@ -438,17 +438,18 @@ module Squared
|
|
|
438
438
|
when 'gem'
|
|
439
439
|
case flag
|
|
440
440
|
when :outdated
|
|
441
|
-
format_desc action, flag, "semver?=major|minor|patch,#{shortname('i', 's', 'u', 'd')},opts*"
|
|
441
|
+
format_desc action, flag, "semver?=(=)major|minor|patch,#{shortname('i', 's', 'u', 'd')},opts*"
|
|
442
442
|
task flag, [:semver] do |_, args|
|
|
443
|
-
opts =
|
|
444
|
-
|
|
443
|
+
opts = if args.semver =~ /^(=)?(major|minor|patch)$/i
|
|
444
|
+
equals = !$1.nil?
|
|
445
|
+
semver = $2.downcase
|
|
445
446
|
args.extras
|
|
446
447
|
else
|
|
447
|
-
semver = nil
|
|
448
448
|
args.to_a
|
|
449
449
|
end
|
|
450
450
|
gem(flag, opts: opts, banner: true, filter: {
|
|
451
451
|
semver: semver,
|
|
452
|
+
equals: equals,
|
|
452
453
|
update: has_value!(opts, 'u', 'update'),
|
|
453
454
|
interactive: has_value!(opts, 'i', 'interactive'),
|
|
454
455
|
select: has_value!(opts, 's', 'select'),
|
|
@@ -562,7 +563,7 @@ module Squared
|
|
|
562
563
|
else
|
|
563
564
|
%w[## ;]
|
|
564
565
|
end
|
|
565
|
-
msg = if
|
|
566
|
+
msg = if Prompt.reline.respond_to?(:readmultiline)
|
|
566
567
|
'ruby>'
|
|
567
568
|
else
|
|
568
569
|
multiline = Array(multiline)
|
|
@@ -691,9 +692,9 @@ module Squared
|
|
|
691
692
|
.lines
|
|
692
693
|
.map { |line| line.sub(/#.*$/, '').strip }
|
|
693
694
|
.reject(&:empty?)
|
|
694
|
-
.yield_self do |
|
|
695
|
-
target =
|
|
696
|
-
target ? [target] :
|
|
695
|
+
.yield_self do |lines|
|
|
696
|
+
target = lines.find { |line| line.include?(tool) }
|
|
697
|
+
target ? [target] : lines
|
|
697
698
|
end
|
|
698
699
|
.join(', ')
|
|
699
700
|
end
|
|
@@ -727,7 +728,7 @@ module Squared
|
|
|
727
728
|
out.map!(&:split)
|
|
728
729
|
pad = as_a(out, :first, :size).max
|
|
729
730
|
print_item
|
|
730
|
-
puts(out.map { |line| '%*s %s' % [pad, line.first, line
|
|
731
|
+
puts(out.map { |line| '%*s %s' % [pad, line.first, line.drop(1).join(' ')] })
|
|
731
732
|
end
|
|
732
733
|
end
|
|
733
734
|
when :reshim
|
|
@@ -1067,6 +1068,7 @@ module Squared
|
|
|
1067
1068
|
buffer = []
|
|
1068
1069
|
filter = kwargs.fetch(:filter, {})
|
|
1069
1070
|
semver = filter[:semver]
|
|
1071
|
+
equals = filter[:equals]
|
|
1070
1072
|
update = if sync && filter[:select]
|
|
1071
1073
|
semver ||= 'major'
|
|
1072
1074
|
items = []
|
|
@@ -1143,6 +1145,8 @@ module Squared
|
|
|
1143
1145
|
when 2
|
|
1144
1146
|
case semver
|
|
1145
1147
|
when 'major', 'minor'
|
|
1148
|
+
next if equals && semver == 'major'
|
|
1149
|
+
|
|
1146
1150
|
update&.push(a)
|
|
1147
1151
|
when 'patch'
|
|
1148
1152
|
next
|
|
@@ -1156,6 +1160,8 @@ module Squared
|
|
|
1156
1160
|
else
|
|
1157
1161
|
case semver
|
|
1158
1162
|
when 'major', 'minor', 'patch'
|
|
1163
|
+
next if equals && semver != 'patch'
|
|
1164
|
+
|
|
1159
1165
|
update&.push(a)
|
|
1160
1166
|
end
|
|
1161
1167
|
unless stdin?
|
|
@@ -1254,26 +1260,36 @@ module Squared
|
|
|
1254
1260
|
case flag
|
|
1255
1261
|
when :build
|
|
1256
1262
|
if op.empty?
|
|
1257
|
-
|
|
1263
|
+
raise Errno::ENOENT, message('gemspec', hint: project) unless gemfile
|
|
1264
|
+
|
|
1258
1265
|
op.add_path(gemfile)
|
|
1259
1266
|
else
|
|
1260
|
-
op.add_first(path: true)
|
|
1267
|
+
op.add_first(path: !op.first.include?('*'), quote: true)
|
|
1261
1268
|
.clear(pass: false)
|
|
1262
1269
|
end
|
|
1263
1270
|
when :push
|
|
1271
|
+
target = gemname
|
|
1264
1272
|
if op.empty? || (n = op.index(':'))
|
|
1265
1273
|
file = basepath(if !n && (spec = gemspec)
|
|
1266
1274
|
"#{spec.name}-#{spec.version}.gem"
|
|
1267
1275
|
else
|
|
1268
1276
|
choice_index 'Select a file', Dir.glob('*.gem', base: path)
|
|
1269
1277
|
end)
|
|
1278
|
+
op.add_path(file)
|
|
1279
|
+
elsif (file = op.shift).include?('*')
|
|
1280
|
+
file = '*.gem' if file == '*'
|
|
1281
|
+
target = Dir.glob(file, base: path).join(', ')
|
|
1282
|
+
raise Errno::ENOENT, message(file, hint: flag) if target.empty?
|
|
1283
|
+
|
|
1284
|
+
op.add_quote(file)
|
|
1270
1285
|
else
|
|
1271
|
-
file = basepath(
|
|
1272
|
-
|
|
1273
|
-
|
|
1286
|
+
file = basepath(file.include?('.') ? file : "#{file}.gem")
|
|
1287
|
+
raise Errno::ENOENT, message(file, hint: flag) unless file.exist?
|
|
1288
|
+
raise ArgumentError, message('unrecognized args', op.join(', '), hint: flag) unless op.empty?
|
|
1289
|
+
|
|
1290
|
+
op.add_path(file)
|
|
1274
1291
|
end
|
|
1275
|
-
|
|
1276
|
-
return run(from: from, interactive: ['Push', 'N', gemname]) unless with || !banner
|
|
1292
|
+
return run(from: from, interactive: ['Push', 'N', target]) unless with || !banner
|
|
1277
1293
|
when :exec
|
|
1278
1294
|
min = if op.arg?('g', 'gem')
|
|
1279
1295
|
1
|
|
@@ -1329,7 +1345,8 @@ module Squared
|
|
|
1329
1345
|
op.unshift(name)
|
|
1330
1346
|
end
|
|
1331
1347
|
end
|
|
1332
|
-
|
|
1348
|
+
raise ArgumentError, message('missing gem name', hint: flag) if op.empty?
|
|
1349
|
+
|
|
1333
1350
|
if op.arg?('all')
|
|
1334
1351
|
if flag == :pristine
|
|
1335
1352
|
append_repeat 'skip', op.extras
|
|
@@ -1369,7 +1386,7 @@ module Squared
|
|
|
1369
1386
|
op << action
|
|
1370
1387
|
op.clear
|
|
1371
1388
|
else
|
|
1372
|
-
|
|
1389
|
+
raise ArgumentError, message('unrecognized command', action, hint: flag)
|
|
1373
1390
|
end
|
|
1374
1391
|
end
|
|
1375
1392
|
when :open, :owner, :unpack, :yank
|
|
@@ -1406,7 +1423,7 @@ module Squared
|
|
|
1406
1423
|
end
|
|
1407
1424
|
end
|
|
1408
1425
|
opts = session_opts(with, args: args, kwargs: kwargs, pass: pass)
|
|
1409
|
-
invalid = ->(a) {
|
|
1426
|
+
invalid = ->(a) { raise ArgumentError, message('unrecognized args', a.join(', '), hint: flag) }
|
|
1410
1427
|
cmd = bundle_session flag
|
|
1411
1428
|
case flag
|
|
1412
1429
|
when :cache, :check, :clean, :init, :install, :lock, :pack, :package, :platform
|
|
@@ -1731,7 +1748,7 @@ module Squared
|
|
|
1731
1748
|
def project
|
|
1732
1749
|
return @project unless @project.frozen?
|
|
1733
1750
|
|
|
1734
|
-
@project = (
|
|
1751
|
+
@project = (gemspec&.name || @project).dup
|
|
1735
1752
|
end
|
|
1736
1753
|
|
|
1737
1754
|
def depend?
|
|
@@ -1948,10 +1965,6 @@ module Squared
|
|
|
1948
1965
|
verbose? ? ['--verbose'] : []
|
|
1949
1966
|
end
|
|
1950
1967
|
|
|
1951
|
-
def variables
|
|
1952
|
-
(super + %i[autodetect]).freeze
|
|
1953
|
-
end
|
|
1954
|
-
|
|
1955
1968
|
def rakefile
|
|
1956
1969
|
if @rakefile.nil?
|
|
1957
1970
|
file = Rake::Application::DEFAULT_RAKEFILES.find { |val| exist?(val) }
|
|
@@ -20,8 +20,8 @@ module Squared
|
|
|
20
20
|
include Shell
|
|
21
21
|
include Prompt
|
|
22
22
|
|
|
23
|
-
def append(target, *args, delim: false, escape: false, quote: true, strip: nil,
|
|
24
|
-
|
|
23
|
+
def append(target, *args, delim: false, escape: false, quote: true, strip: nil, double: false, filter: nil,
|
|
24
|
+
pass: nil, **kwargs)
|
|
25
25
|
return if (ret = args.flatten(1)).empty?
|
|
26
26
|
|
|
27
27
|
target << '--' if delim && !target.include?('--')
|
|
@@ -52,7 +52,7 @@ module Squared
|
|
|
52
52
|
if !(pa = val.is_a?(Pathname)) && escape
|
|
53
53
|
shell_escape(val, quote: quote, double: double)
|
|
54
54
|
elsif quote || pa
|
|
55
|
-
shell_quote(val,
|
|
55
|
+
shell_quote(val, double: double, **kwargs)
|
|
56
56
|
else
|
|
57
57
|
val
|
|
58
58
|
end
|
|
@@ -135,7 +135,7 @@ module Squared
|
|
|
135
135
|
[name, $3, $2 || (name.size == 1 && $1.empty? ? true : '')]
|
|
136
136
|
end
|
|
137
137
|
|
|
138
|
-
def arg?(target, *args, value: false
|
|
138
|
+
def arg?(target, *args, value: false)
|
|
139
139
|
r, s = args.partition { |val| val.is_a?(Regexp) }
|
|
140
140
|
r << matchopts(s, value) unless s.empty?
|
|
141
141
|
a = target.to_a
|
|
@@ -315,7 +315,7 @@ module Squared
|
|
|
315
315
|
end
|
|
316
316
|
numtype = [
|
|
317
317
|
[i, /\A\d+\z/],
|
|
318
|
-
[f, /\A\d*(
|
|
318
|
+
[f, /\A\d*(\.\d+)?\z/],
|
|
319
319
|
[si, /\A-?\d+\z/]
|
|
320
320
|
].freeze
|
|
321
321
|
numcheck = ->(k, v) { numtype.any? { |flag, pat| flag.include?(k) && v.match?(pat) } }
|
|
@@ -609,7 +609,7 @@ module Squared
|
|
|
609
609
|
val = OptionPartition.send(:matchopts, val) unless val.is_a?(Regexp)
|
|
610
610
|
blk = proc { |s| s&.match?(val) }
|
|
611
611
|
else
|
|
612
|
-
raise TypeError,
|
|
612
|
+
raise TypeError, Common::Format.message('unknown', val, hint: target.first)
|
|
613
613
|
end
|
|
614
614
|
end
|
|
615
615
|
ret = find_all(&blk)
|
|
@@ -658,10 +658,7 @@ module Squared
|
|
|
658
658
|
|
|
659
659
|
def readline(msg, fallback = nil, option: nil, quote: false, force: true, double: false)
|
|
660
660
|
begin
|
|
661
|
-
|
|
662
|
-
ret = Readline.readline("#{msg}#{force ? ':' : '?'} ", false).strip
|
|
663
|
-
rescue LoadError
|
|
664
|
-
raise unless (ret = fallback) || !force
|
|
661
|
+
ret = Common::Prompt.reline.readline("#{msg}#{force ? ':' : '?'} ", false).strip
|
|
665
662
|
rescue Interrupt
|
|
666
663
|
exit(force ? 1 : 0)
|
|
667
664
|
else
|
|
@@ -7,6 +7,15 @@ module Squared
|
|
|
7
7
|
module Utils
|
|
8
8
|
private
|
|
9
9
|
|
|
10
|
+
def symjoin(*args, char: ':')
|
|
11
|
+
args.flatten.join(char).to_sym
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def collect_hash(data, pass: [])
|
|
15
|
+
data = data.reject { |key,| pass.include?(key) } unless pass.empty?
|
|
16
|
+
data.values.flatten
|
|
17
|
+
end
|
|
18
|
+
|
|
10
19
|
def rand_s(size)
|
|
11
20
|
require 'random/formatter'
|
|
12
21
|
Random.new.alphanumeric(size)
|
|
@@ -26,7 +35,7 @@ module Squared
|
|
|
26
35
|
end
|
|
27
36
|
end
|
|
28
37
|
|
|
29
|
-
def matchmap(list, prefix
|
|
38
|
+
def matchmap(list, prefix: nil)
|
|
30
39
|
list.map do |val|
|
|
31
40
|
next val if val.is_a?(Regexp)
|
|
32
41
|
|
|
@@ -20,7 +20,7 @@ module Squared
|
|
|
20
20
|
elsif !repo_install? && !repo_confirm
|
|
21
21
|
@root = nil
|
|
22
22
|
end
|
|
23
|
-
|
|
23
|
+
raise Errno::EEXIST, message(path.cleanpath, hint: 'REPO_HOME') unless @root
|
|
24
24
|
end
|
|
25
25
|
path.realdirpath
|
|
26
26
|
elsif (val = env('REPO_ROOT'))
|
|
@@ -28,7 +28,7 @@ module Squared
|
|
|
28
28
|
if !@root.exist?
|
|
29
29
|
@root.mkpath
|
|
30
30
|
elsif !repo_install?(parent: true) && !repo_confirm
|
|
31
|
-
|
|
31
|
+
raise Errno::EEXIST, message(@root, hint: 'REPO_ROOT')
|
|
32
32
|
end
|
|
33
33
|
@root.join(main).realdirpath
|
|
34
34
|
elsif repo_install?(parent: true) && (!home.exist? || @root + main == home)
|
|
@@ -277,7 +277,7 @@ module Squared
|
|
|
277
277
|
end
|
|
278
278
|
end
|
|
279
279
|
|
|
280
|
-
def repo_run(cmd, opts = [], exception:
|
|
280
|
+
def repo_run(cmd, opts = [], exception: exception?, options: true, **kwargs)
|
|
281
281
|
cmd = [repo_bin, cmd]
|
|
282
282
|
cmd << opts.uniq.join(' ') unless opts.empty?
|
|
283
283
|
env('REPO_OPTIONS', **kwargs) { |val| cmd << val } if options
|
|
@@ -310,7 +310,7 @@ module Squared
|
|
|
310
310
|
r = r.keys
|
|
311
311
|
pass = g.empty? && r.empty?
|
|
312
312
|
select do |proj|
|
|
313
|
-
next unless proj.enabled?(baseref)
|
|
313
|
+
next unless proj.enabled?(ref: baseref)
|
|
314
314
|
|
|
315
315
|
proj.global_set(name)
|
|
316
316
|
i = -1
|
|
@@ -341,7 +341,7 @@ module Squared
|
|
|
341
341
|
task_invoke(name, **proj.workspace.invokeargs)
|
|
342
342
|
end
|
|
343
343
|
rescue => e
|
|
344
|
-
raise if exception
|
|
344
|
+
raise if exception?
|
|
345
345
|
|
|
346
346
|
warn log_warn(e, pass: true) if warning
|
|
347
347
|
end
|
|
@@ -38,10 +38,18 @@ module Squared
|
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
if (args = obj.batchargs)
|
|
41
|
-
|
|
41
|
+
if args.first.is_a?(Hash)
|
|
42
|
+
batch_set(obj.ref, *args)
|
|
43
|
+
else
|
|
44
|
+
batch_set(*args)
|
|
45
|
+
end
|
|
42
46
|
end
|
|
43
47
|
if (args = obj.aliasargs)
|
|
44
|
-
|
|
48
|
+
if args.first.is_a?(Hash)
|
|
49
|
+
alias_set(obj.ref, *args)
|
|
50
|
+
else
|
|
51
|
+
alias_set(*args)
|
|
52
|
+
end
|
|
45
53
|
end
|
|
46
54
|
end
|
|
47
55
|
workspace.config_get(:batch)&.each { |args| batch_set(*args) }
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: squared
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- An Pham
|
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
125
125
|
- !ruby/object:Gem::Version
|
|
126
126
|
version: '0'
|
|
127
127
|
requirements: []
|
|
128
|
-
rubygems_version: 4.0.
|
|
128
|
+
rubygems_version: 4.0.10
|
|
129
129
|
specification_version: 4
|
|
130
130
|
summary: Rake task generator for managing multi-language workspaces.
|
|
131
131
|
test_files: []
|