使用mina的子目录。

ruby
阅读 35 收藏 0 点赞 0 评论 0

subdir.rb
# encoding: utf-8

#
# This extension allows you to select a subdirectory instead of a whole repository.
# It is useful when you're fetching a git project and your actual code is in a
# subdirectory.
#

namespace :subdir do
  desc "Select a subdirectory as the root of your project"
  task :select do
    commands = %[
      echo "-----> Using '#{subdirectory!}' as subdirectory" &&
      if [ ! -d "#{subdirectory!}" ]; then
        echo "-----> The directory #{deploy_to}/$build_path/#{subdirectory!} hasn't been found." &&
        exit 1
      else
        #{echo_cmd %[shopt -s dotglob]} &&
        #{echo_cmd %[mv ./#{subdirectory!} #{deploy_to}/tmp/subdirectory]} &&
        #{echo_cmd %[rm -fr ./*]} &&
        #{echo_cmd %[mv #{deploy_to}/tmp/subdirectory/* ./]} &&
        #{echo_cmd %[rmdir #{deploy_to}/tmp/subdirectory]} &&
        #{echo_cmd %[shopt -u dotglob]}
      fi
    ]

    queue commands
  end
end
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号