Skip to content

Commit

Permalink
login into input file dir
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Sep 25, 2024
1 parent eaade2d commit 1b77d13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/packmol_runner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ function run_packmol end
@doc (@doc run_packmol)
function run_packmol(input_file::String)
isfile(input_file) || error("Input file not found: $input_file")
# go into directory of input file
current_dir = pwd()
println("Current directory: $current_dir")
input_file_dir = dirname(abspath(input_file))
Expand All @@ -41,8 +40,10 @@ function run_packmol(input_file::String)
println("Output file: $ouput_file_name")
# Run packmol
try
cd(input_file_dir)
run(pipeline(`$packmol_runner`, stdin=input_file))
println("Wrote output to: ", ouput_file_name)
cd(current_dir)
catch
cd(current_dir)
@error "Error running packmol" _file=nothing _line=nothing
Expand Down

0 comments on commit 1b77d13

Please sign in to comment.