Skip to content

Commit

Permalink
Merge pull request #578 from mina-deploy/fix/folder_validations
Browse files Browse the repository at this point in the history
Add folder validation for symlinking
  • Loading branch information
d4be4st authored Oct 6, 2017
2 parents a1865e1 + af6f8e2 commit 73e3666
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tasks/mina/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
comment %{Symlinking shared paths}

fetch(:shared_dirs, []).each do |linked_dir|
command %{
if [ ! -d "#{fetch(:shared_path)}/#{linked_dir}" ]; then
echo "! ERROR: not set up."
echo "The directory '#{fetch(:shared_path)}/#{linked_dir}' does not exist on the server"
echo "You may need to run 'mina setup' first"
exit 18
fi
}
command %{mkdir -p #{File.dirname("./#{linked_dir}")}}
command %{rm -rf "./#{linked_dir}"}
command %{ln -s "#{fetch(:shared_path)}/#{linked_dir}" "./#{linked_dir}"}
Expand Down

0 comments on commit 73e3666

Please sign in to comment.