Skip to content

Commit

Permalink
Add support to create symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
pkazi authored Oct 15, 2024
1 parent f7f12cb commit c6f8053
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/onceover/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ def deploy_local(repo = Onceover::Controlrepo.new, opts = {})
# add to list of files copied to cache by onceover
onceover_manifest << relative_source

if File.directory? source
if File.symlink?(source)
# Handle symlinks
link_target = File.readlink(source) # Get the target of the symlink
FileUtils.ln_s link_target, target, force: true # Create symlink at target
elsif File.directory? source
Find.prune if excluded_dirs.include? source
FileUtils.mkdir target
else
Expand Down

0 comments on commit c6f8053

Please sign in to comment.