浏览代码

Delete output directory at start of build

tags/v2.0.0
Adrian Short 6 年前
父节点
当前提交
948b3e084a
共有 1 个文件被更改,包括 5 次插入6 次删除
  1. +5
    -6
      bin/build

+ 5
- 6
bin/build 查看文件

@@ -81,12 +81,11 @@ def write_page(path_items, template, locals = {})
# https://support.google.com/webmasters/answer/183668?hl=en&ref_topic=4581190 # https://support.google.com/webmasters/answer/183668?hl=en&ref_topic=4581190
end end


test_dir = File.join(Dir.pwd, OUTPUT_DIR)
# FIXME - clear output directory at the start of every run
# FileUtils.rm_rf(test_dir)

Dir.mkdir(test_dir) unless File.directory?(test_dir)
Dir.chdir(test_dir)
working_dir = File.join(Dir.pwd, OUTPUT_DIR)
# Recursively delete working directory to ensure no redundant files are left behind from previous builds.
FileUtils.rm_rf(working_dir)
Dir.mkdir(working_dir) unless File.directory?(working_dir)
Dir.chdir(working_dir)


# Copy `public` dir to output dir # Copy `public` dir to output dir
FileUtils.copy_entry(File.join('..', 'public'), '.') FileUtils.copy_entry(File.join('..', 'public'), '.')


正在加载...
取消
保存