Browse Source

Clean output directory before build

tags/v0.4.0
Adrian Short 6 years ago
parent
commit
b1b04d7c3a
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      lib/petrify.rb
  2. +1
    -1
      lib/petrify/version.rb

+ 2
- 2
lib/petrify.rb View File

@@ -43,9 +43,9 @@ module Petrify


def self.setup def self.setup
# Recursively delete working directory to ensure no redundant files are left behind from previous builds. # Recursively delete working directory to ensure no redundant files are left behind from previous builds.
# FileUtils.rm_rf(@working_dir)
# But preserve dot-files (especially .git directory)
FileUtils.rm_r(Dir.glob(File.join(@@working_dir, '*')))
Dir.mkdir(@@working_dir) unless File.directory?(@@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('public', @@working_dir) FileUtils.copy_entry('public', @@working_dir)


+ 1
- 1
lib/petrify/version.rb View File

@@ -1,3 +1,3 @@
module Petrify module Petrify
VERSION = "0.1.0"
VERSION = "0.2.0"
end end

Loading…
Cancel
Save