hiiro 0.1.244 → 0.1.245

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 +17 -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: 0f17dace65e61336b293b28158d0bf86343aafa25220068d2854b0d8f86f629d
4
- data.tar.gz: 876c7ca80b13ad9ba63629c28981da336da2f175aab30a262e3d56b2d6e46db5
3
+ metadata.gz: 07d46822be5511ac65285e5499d50ccd442de23e38c7d4bf99f1e349e214a14f
4
+ data.tar.gz: d5a37c09e78895a1d354ac3ed0bf94afe4543c4b2ede4bafff1e9a3cd144cdda
5
5
  SHA512:
6
- metadata.gz: cf87f4b3e17a2d51890892e111eba2f4d648c0ff8ea52fd1ecf55472793f985a2f1eda0971484e0679dde0b632615f595ee73e6d5e9220b3e2c585afa8f37781
7
- data.tar.gz: 80544422e70d69821bf6f7df380fd897ca9813e4f57f1d82491f7d86f4d49d36fa5d725aab605a08ae0456a1d4c4d5dc9b6faaa3130f4564b81fd10cbb562356
6
+ metadata.gz: 0e702bc3617d434c65251a5d96cef34b3d760c69b625ac30094bd6f3567096a11a8ad93ea3e1191b2ee922f8b766fce66df9c792818a5b06ba1c871db3a748d1
7
+ data.tar.gz: 7f5678dde901168d0376dbf93d75972f5968120a3c37caebba0997bd71848325b8742703363055f83d349bd4fc5c3ea28f5c3b4b7811afd8537c778a87300b00
data/bin/h-wtree CHANGED
@@ -14,6 +14,23 @@ Hiiro.run(*ARGV) do
14
14
  add_subcmd(:repair) { |*args| system('git', 'worktree', 'repair', *args) }
15
15
  add_subcmd(:unlock) { |*args| system('git', 'worktree', 'unlock', *args) }
16
16
 
17
+ add_subcmd(:switch) do |path|
18
+ if path.nil?
19
+ lines = `git worktree list`.strip.split("\n")
20
+ if lines.empty?
21
+ STDERR.puts "No worktrees found"
22
+ next
23
+ end
24
+ map = lines.each_with_object({}) { |line, h| h[line] = line.split.first }
25
+ path = fuzzyfind_from_map(map)
26
+ next unless path
27
+ end
28
+
29
+ path = File.expand_path(path)
30
+ session_name = File.basename(path)
31
+ Hiiro::Tmux.open_session(session_name, start_directory: path)
32
+ end
33
+
17
34
  add_subcmd(:select) do |*args|
18
35
  # Get worktree list
19
36
  output = `git worktree list`.strip
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.244"
2
+ VERSION = "0.1.245"
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.244
4
+ version: 0.1.245
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota