mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 01:36:13 +00:00
Use cross-platform ruby mktmpdir in comparelinks.rb
This commit is contained in:
parent
cdb7f24ef9
commit
b5d2cbe5ce
1 changed files with 40 additions and 39 deletions
|
@ -3,12 +3,7 @@
|
|||
|
||||
## Example: ruby ./_contrib/comparelinks.rb master newbranch > ../diff
|
||||
|
||||
WORKDIR = `mktemp -d`
|
||||
WORKDIR.gsub!("\n",'')
|
||||
|
||||
at_exit {
|
||||
`rm -fr "#{WORKDIR}"`
|
||||
}
|
||||
require 'tmpdir'
|
||||
|
||||
def prompt(*args)
|
||||
print(*args)
|
||||
|
@ -52,6 +47,10 @@ def fetchlinks()
|
|||
|
||||
end
|
||||
|
||||
Dir.mktmpdir{|workdir|
|
||||
|
||||
WORKDIR=workdir.gsub("\n",'')
|
||||
|
||||
# Copy current repository to a temporary directory
|
||||
`rsync -a ./ "#{WORKDIR}/"`
|
||||
|
||||
|
@ -92,3 +91,5 @@ if diffrmlinks.length > 0
|
|||
diff = diff + "## links removed\n\n" + diffrmlinks.join("\n") + "\n\n"
|
||||
end
|
||||
print diff
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue