Skip to content

Commit

Permalink
Minor code simplifications/clarifications
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrebouchard committed Sep 7, 2023
1 parent d93bb81 commit a1fb27b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/Pigeons.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import Base.merge

import DynamicPPL

const use_auto_exec_folder = ""
const use_auto_exec_folder = "use_auto_exec_folder"

include("includes.jl")

Expand Down
11 changes: 3 additions & 8 deletions src/utils/exec_folder.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,15 @@ function safelink(target::AbstractString, link::AbstractString)
try
symlink(relative_path, link)
catch e # on windows, need admin to do symlink (!)
if !_safelink_warned[]
println("""
WARN: could not create symlink($relative_path, $link)
@warn """
Could not create symlink($relative_path, $link)
If you are running windows, this is a known issue,
you will need to run under admin permission, see:
https://discourse.julialang.org/t/symlink-can-not-create-hardlink-in-windows10/75702
For now, skipping symlinks, this may affect some features
such as loading checkpoints.
Details:
$e
""")
_safelink_warned[] = true
end
""" maxlog=1
end
end

const _safelink_warned::Ref{Bool} = Ref(false)
9 changes: 0 additions & 9 deletions src/utils/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,3 @@ function sort_includes(main)
error(msg)
end
end

function sh(script::AbstractString)
path, io = mktemp()
write(io, script)
close(io)
result = read(`sh $path`, String)
println(result)
return result
end

0 comments on commit a1fb27b

Please sign in to comment.