示例#1
0
文件: command.py 项目: ahua/python
 def doit(self, dest, server, app):
     SUB_DIR = "files"
     
     real = os.path.join(self.AVAILABLE_DIR, app, SUB_DIR)
     symb = os.path.join(self.ENABLED_DIR, app, SUB_DIR)
     run("mkdir -p %s"%(real))
     
     ensure_remote_dir(os.path.dirname(symb))
     run("if [ ! -h %s ]; then rm -rf %s; ln -s %s %s; fi"%(symb, symb, real, symb))
     
     file_dir = os.path.join(PROJECT_DIR, app, SUB_DIR)
     abs_file_path = os.path.join(file_dir, self.options.file)
     if os.path.isfile(abs_file_path):
         ensure_remote_file(abs_file_path, os.path.join(real, self.options.file))
示例#2
0
文件: command.py 项目: ahua/python
 def doit(self, dest, server, app):
     SUB_DIR = "scripts"
     real = os.path.join(self.AVAILABLE_DIR, app, SUB_DIR)
     symb = os.path.join(self.ENABLED_DIR, app, SUB_DIR)
     run("mkdir -p %s"%(real))
     
     ensure_remote_dir(os.path.dirname(symb))
     run("if [ ! -h %s ]; then rm -rf %s; ln -s %s %s; fi"%(symb, symb, real, symb))
     
     script_path = self.get_script_path() 
     local_script_path = os.path.join(PROJECT_DIR, app, SUB_DIR, script_path)
     remote_script_path = os.path.join(real, script_path)
     
     ensure_remote_dir(os.path.dirname(remote_script_path))
     
     if self.options.force:
         put(local_script_path, remote_script_path)
     else:
         ensure_remote_file(local_script_path, remote_script_path)
         
     run("chmod +x %s; %s"%(remote_script_path, remote_script_path))