diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2025-06-07 22:10:27 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2025-06-07 22:12:27 -0400 |
commit | e5968416719e4017435aabe02ccd0f49113f7e66 (patch) | |
tree | 33c1ee0577b7c777eb2b67460b0c19d679fe2b2a /org/shared.org | |
parent | updates to nix flake, envrc-nix, gitignore (diff) |
- appear to be related to finding program install
path across symlinked directories, fixed using
suitable ruby check
Diffstat (limited to 'org/shared.org')
-rw-r--r-- | org/shared.org | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/org/shared.org b/org/shared.org index 34d17bd0..ced99872 100644 --- a/org/shared.org +++ b/org/shared.org @@ -152,19 +152,21 @@ module SiSU_Images def images_set @pwd=(/(\S+?)(?:\/(?:#{Px[:lng_lst_rgx]}))?$/).match(Dir.pwd)[1] def copy(src_path,dest_path,images=nil) - if FileTest.directory?(src_path) + require 'pathname' + src_path = Pathname.new(src_path) + dest_path = Pathname.new(dest_path) + if src_path.directory? FileUtils::cd(src_path) unless images images=Dir.glob("*.{png,jpg,gif,ico}") end - unless FileTest.directory?(dest_path) \ - or FileTest.symlink?(dest_path) + unless dest_path.directory? FileUtils::mkdir_p(dest_path) FileUtils::chmod(0755,dest_path) end if images.length > 0 images.each do |i| - if FileTest.file?(i) + if Pathname#exist?(i) FileUtils::cp_r(i,"#{dest_path}/#{i}") FileUtils::chmod(0644,"#{dest_path}/#{i}") else STDERR.puts %{\t*WARN* did not find image - "#{i}" [#{__FILE__}:#{__LINE__}]} |