forked from meteor/meteor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sashko Stubailo
committed
Jul 30, 2015
1 parent
051ba43
commit 6f6bdd1
Showing
1 changed file
with
26 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,26 @@ | ||
#! /usr/bin/env ruby | ||
|
||
# This script takes two arguments: | ||
# 1. The name of a package - ex. ejson | ||
# 2. The name of an export - ex. EJSON | ||
# It makes sure that if the export appears somewhere in package source code, the | ||
# name of the package appears somewhere in package.js for that package. | ||
|
||
root = File.join(File.dirname(__FILE__), "..", ".."); | ||
|
||
Dir.chdir(root) | ||
|
||
file_list = `git grep -l '#{ARGV[0]}' packages/`.lines | ||
package_list = file_list.map do |filename| | ||
filename.split("/")[1] | ||
end | ||
|
||
package_list = package_list.uniq | ||
|
||
package_list.each do |p| | ||
unless File.open("packages/#{p}/package.js").read.include? ARGV[1] | ||
puts "'#{ARGV[0]}' appears in #{p} but '#{ARGV[1]}' not in package.js. Files:" | ||
puts `git grep -l '#{ARGV[0]}' packages/#{p}/` | ||
puts "" | ||
end | ||
end |