Skip to content

Commit

Permalink
ci: implement clean and put_readme :)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexox committed Jun 21, 2024
1 parent e0a5624 commit 52d4281
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions packaging/pack.rb
100644 → 100755
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]

0 comments on commit 52d4281

Please sign in to comment.