-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: implement clean and put_readme :)
- Loading branch information
Showing
1 changed file
with
29 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,34 @@ | ||
VERSION = 1.6.17 | ||
#!/usr/bin/env ruby | ||
|
||
DIST_DIR = File.join(__dir__, "..", "dist") | ||
require "fileutils" | ||
|
||
def clean | ||
Dir["**/README.md"] | ||
Dir["**/lefthook*"] | ||
system("git clean -fdX npm-installer/ npm-bundled/ npm-bundled/bin/ rubygems/libexec/ rubygems/pkg/") | ||
end | ||
VERSION = "1.6.17" | ||
|
||
ROOT = File.join(__dir__, "..") | ||
DIST = File.join(ROOT, "dist") | ||
|
||
module Pack | ||
module_function | ||
|
||
def put_readme | ||
Dir["npm/*"].each do |npm_dir| | ||
FileUtils.cp("../README.md", npm_dir) | ||
def clean | ||
FileUtils.cd(__dir__) | ||
print "Cleaning... " | ||
FileUtils.rm(Dir["npm/**/README.md"]) | ||
FileUtils.rm(Dir["npm/**/lefthook*"].filter(&File.method(:file?))) | ||
system("git clean -fdX npm-installer/ npm-bundled/ npm-bundled/bin/ rubygems/libexec/ rubygems/pkg/") | ||
puts "done" | ||
end | ||
|
||
def put_readme | ||
FileUtils.cd(__dir__) | ||
print "Putting READMEs... " | ||
Dir["npm/*"].each do |npm_dir| | ||
FileUtils.cp(File.join(ROOT, "README.md"), File.join(npm_dir, "README.md"), verbose: true) | ||
end | ||
FileUtils.cp(File.join(ROOT, "README.md"), "npm-bundled/", verbose: true) | ||
FileUtils.cp(File.join(ROOT, "README.md"), "npm-installer/", verbose: true) | ||
puts "done" | ||
end | ||
FileUtils.cp("../README.md", "npm-bundled/") | ||
FileUtils.cp("../README.md", "npm-installer/") | ||
end | ||
|
||
Pack.public_send ARGV[0] |