hiiro 0.1.243 → 0.1.244

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/h-wtree +16 -0
  3. data/lib/hiiro/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 451f995a33a97fcc96f14d46d9e5db921bd0fd7d3c82e3398f36b38c11acdcbe
4
- data.tar.gz: 297b009bba497838b4c9c2b1958632feb84e4348fcbd5027e7663f146e3c3cf1
3
+ metadata.gz: 0f17dace65e61336b293b28158d0bf86343aafa25220068d2854b0d8f86f629d
4
+ data.tar.gz: 876c7ca80b13ad9ba63629c28981da336da2f175aab30a262e3d56b2d6e46db5
5
5
  SHA512:
6
- metadata.gz: c7c71c733b7be2b9a12ba342d681bef838a3a79b54eda8e4f0ca05a996f7738104a709079591d36465d9dc52eddcca0a3e681ea54b5433c2c82b38a97b9c1c40
7
- data.tar.gz: '0295aa80f43ab13e2b8f1bae5a0a1fa37f1527d90384bc4167365eb183ab42d5743338f4aab8c4c9d754b8de5625f638434e79358595e44f9316dd0f9ef28514'
6
+ metadata.gz: cf87f4b3e17a2d51890892e111eba2f4d648c0ff8ea52fd1ecf55472793f985a2f1eda0971484e0679dde0b632615f595ee73e6d5e9220b3e2c585afa8f37781
7
+ data.tar.gz: 80544422e70d69821bf6f7df380fd897ca9813e4f57f1d82491f7d86f4d49d36fa5d725aab605a08ae0456a1d4c4d5dc9b6faaa3130f4564b81fd10cbb562356
data/bin/h-wtree CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'hiiro'
4
+ require 'shellwords'
4
5
 
5
6
  Hiiro.run(*ARGV) do
6
7
  add_subcmd(:ls) { |*args| system('git', 'worktree', 'list', *args) }
@@ -35,6 +36,21 @@ Hiiro.run(*ARGV) do
35
36
  end
36
37
  end
37
38
 
39
+ add_subcmd(:size) do |*args|
40
+ output = `git worktree list`.strip
41
+
42
+ if output.empty?
43
+ STDERR.puts "No worktrees found"
44
+ next
45
+ end
46
+
47
+ output.split("\n").each do |line|
48
+ path, *rest = line.split
49
+ size = `du -sh #{Shellwords.escape(path)} 2>/dev/null`.split.first || "?"
50
+ puts "#{size}\t#{path} #{rest.join(' ')}"
51
+ end
52
+ end
53
+
38
54
  add_subcmd(:copy) do |*args|
39
55
  output = `git worktree list`.strip
40
56
 
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.243"
2
+ VERSION = "0.1.244"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiiro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.243
4
+ version: 0.1.244
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota