filecon 0.7.1 → 0.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39b5d282890f2a71e7d928cd772e5e4d1c539bee82f49bd20a078f2fdb3c42d6
4
- data.tar.gz: 654d4cecbf3fadccd929459f6488ff7795006db209d63da38b7e7387a30c312c
3
+ metadata.gz: 7670630693e1cef53e636d2d81dee3779c0237456647b38962c12bda4bb81274
4
+ data.tar.gz: f2b38e25d2900e372287308d0e9c25a9f1c2e214860d63bd5fffc7891675a553
5
5
  SHA512:
6
- metadata.gz: 88defb4160b8ff0d433f9de6d01a27c631f8514ac54307bf159bccc64f9506abc179e97fe66dd82a94b46d9d288654a13bd8dac28241a54912b5d403c57c43ea
7
- data.tar.gz: 3f601ebdf45b5015199ee27d9e809d31bee82cbad121d8787562af3d9c74b56a337f6cc6157994a12f0908121bf84f741ddff90afd09e7e6304f0b673e787ab6
6
+ metadata.gz: 602b4f408a63a6783bc7dfd07131ba1f67d94233e928c5d93051d6c355817e10c83f93b797801cad0f5e083374c494deb3585ed45869c889f947e893ef7286c6
7
+ data.tar.gz: d6b91aa19de3911f71b70d3d528e50d43caa911eb03a879566f19543b9d73a8273ec93bee3e70c0ae5b8775544858f5b753211064cf47726a72f894d51e97a14
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## [vx.y.z] — __DATE__
4
4
 
5
+ ## [v0.7.2] — 2026-10-19
6
+
7
+ ### Fixed
8
+ - Recurse (and listing in general) survives filenames with invalid byte sequences — path splitting now works on byte copies and the hidden-file check on scrubbed copies, so a single latin-1 relic no longer kills the whole walk with `invalid byte sequence in UTF-8`; startup history parsing got the same one-word hardening instead of silently discarding all history
9
+ - Same-filesystem `move` renames instead of re-copying — `transfer` tries `File.rename` first (instant, `mv`-style, and it moves symlinks as links), falling back to the rsync copy only across filesystems
10
+ - The `|`-command branch no longer crashes when the command cannot launch (`run` reports the launch failure as its return value, which `dispatch` then tried to read like a stream)
11
+ - The listing refreshes right after a transfer completes, with no keypress: the viewed directory (including a destination reached via the `%dir` pick) is rescanned, the trailing repaint-and-wait steps are gone, and the status line keeps only the tally instead of an echoed command line
12
+
5
13
  ## [v0.7.1] — 2026-10-13
6
14
 
7
15
  ### Fixed
data/bin/filecon CHANGED
@@ -22,7 +22,7 @@ begin
22
22
 
23
23
  [dh_path, ch_path].each { |f| FileUtils.touch f }
24
24
 
25
- parse = ->(p) { File.readlines(p).map { |l| s = l.chomp.split(",", 2); [s[0].to_i, s[1]] } rescue [] }
25
+ parse = ->(p) { File.readlines(p).map { |l| s = l.chomp.scrub.split(",", 2); [s[0].to_i, s[1]] } rescue [] }
26
26
 
27
27
  config = Filecon.load_config(bundled_path, "/etc/filecon/config.yaml", config_path)
28
28
 
data/filecon.1 CHANGED
@@ -1,4 +1,4 @@
1
- .TH FILECON 1 "2026-10-13" "filecon 0.7.1" "User Commands"
1
+ .TH FILECON 1 "2026-10-19" "filecon 0.7.2" "User Commands"
2
2
  .SH NAME
3
3
  filecon \- a file and command manager that lives between terminal and shell
4
4
  .SH SYNOPSIS
@@ -1,3 +1,3 @@
1
1
  module Filecon
2
- VERSION = "0.7.1"
2
+ VERSION = "0.7.2"
3
3
  end
data/lib/filecon.rb CHANGED
@@ -62,7 +62,7 @@ class Filecon::App < Typr::Browser
62
62
  def directory
63
63
  @directory.is_a?(Array) ? @directory.inject { |a, b|
64
64
  common = []
65
- a.split("/").zip(b.split("/")).each { |x, y|
65
+ a.b.split("/").zip(b.b.split("/")).each { |x, y|
66
66
  break if x != y
67
67
  common << x
68
68
  }
@@ -78,7 +78,7 @@ class Filecon::App < Typr::Browser
78
78
  Dir.exist?(d) && File.readable?(d) && File.executable?(d) ? d : nil }
79
79
  prefix = dirs.inject { |a, b|
80
80
  common = []
81
- a.split("/").zip(b.split("/")).each { |x, y|
81
+ a.b.split("/").zip(b.b.split("/")).each { |x, y|
82
82
  break if x != y
83
83
  common << x
84
84
  }
@@ -260,6 +260,8 @@ class Filecon::App < Typr::Browser
260
260
  if File.directory?( src ) and !File.symlink?( src )
261
261
  FileUtils.mkdir_p( dst )
262
262
  done += 1
263
+ elsif op == :move and ( File.rename(src, dst) rescue false )
264
+ done += 1
263
265
  else
264
266
  if @has_rsync.nil?
265
267
  begin
@@ -323,9 +325,8 @@ class Filecon::App < Typr::Browser
323
325
  colors: { default: @colors[:error], border: @colors[:border] },
324
326
  alternate: false).pick(:none)
325
327
  end
326
- show
327
- Typr.read_key
328
- tally
328
+ @user.show tally
329
+ nil
329
330
  end
330
331
 
331
332
  def resolve_conflict src, dst
@@ -454,7 +455,7 @@ class Filecon::App < Typr::Browser
454
455
  io.close
455
456
  text.pick(:none)
456
457
  elsif cmd[0] == ?|
457
- line = io.gets
458
+ line = io&.gets
458
459
  if line
459
460
  nc, ac = @colors[:commands]
460
461
  head = name ? "#{color_code(nc)}#{name}#{color_code(ac)}:" : color_code(nc)
@@ -469,7 +470,6 @@ class Filecon::App < Typr::Browser
469
470
  head = name ? "#{color_code(nc)}#{name}#{color_code(ac)}:" : color_code(nc)
470
471
  @user.show "> #{head}#{cmd[1..-1]}#{color_code(@colors[:default])} : #{output.lines.last}"
471
472
  show
472
- Typr.read_key
473
473
  end
474
474
  end
475
475
  if io.is_a?(IO) and !io.closed?
@@ -483,6 +483,10 @@ class Filecon::App < Typr::Browser
483
483
  end
484
484
  Array(id).sort.reverse.each { |i| refresh_row i } if id && cmd[0..2] != '!cd' && @directory == dir
485
485
  @selected[:rows] = [] if id && @directory != dir
486
+ if id && cmd[0..2] != '!cd' && @directory != dir
487
+ cd @directory
488
+ sort
489
+ end
486
490
  show
487
491
  io
488
492
  end
@@ -604,7 +608,7 @@ class Filecon::App < Typr::Browser
604
608
  return if @directory.is_a?(Array)
605
609
  root = File.expand_path(@directory)
606
610
  dirs = [root] + Dir.glob("**/*", File::FNM_DOTMATCH, base: root).sort.filter_map { |p|
607
- next if !@show_hidden && p.split(?/).any? { |c| c.start_with?(?.) }
611
+ next if !@show_hidden && p.scrub.split(?/).any? { |c| c.start_with?(?.) }
608
612
  d = File.expand_path(p, root)
609
613
  d if File.directory?(d)
610
614
  }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filecon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kilian Reitmayr
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-10-13 00:00:00.000000000 Z
10
+ date: 2026-10-19 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: typr