forked from houshuang/folders2web
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates all the ref: pages in wiki, useful for implementing new template
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
$:.push(File.dirname($0)) | ||
require 'utility-functions' | ||
require 'wiki-lib' | ||
|
||
# script which goes through all the ref pages in wiki, and updates headers | ||
attempt = 0 | ||
success = 0 | ||
Dir.foreach(Wiki_path + "/data/pages/ref") do |f| | ||
next if f == '.' or f == '..' | ||
next unless f.size < 4 || f[-4..-1].downcase == '.txt' | ||
ref = f[0..-5] | ||
attempt += 1 | ||
try { ensure_refpage(ref) | ||
success += 1 | ||
} | ||
end | ||
|
||
puts "#{success} ref pages updated, out of #{attempt} attempted." |