-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: pass directory instead of list of files to js2c.py
On Windows there is a limit to the length of commands, so there will be an error once the lengths of the JS file names combined exceed that limit. This patch modifies js2c.py so that it now takes a --directory argument to glob for .js and .mjs files in addition to the list of files passed directly. We still pass the additional files we include from deps/ directly through the command line, as we only includes some of them so we cannot simply glob, but those are limited so listing them out should be fine. Refs: https://docs.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation PR-URL: #39069 Refs: #38971 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
- Loading branch information
1 parent
d069c72
commit 0e22115
Showing
4 changed files
with
63 additions
and
221 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
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
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,22 @@ | ||
#!/usr/bin/env python | ||
|
||
""" | ||
This is a utility for recursively searching files under | ||
a specified directory | ||
""" | ||
|
||
import argparse | ||
import utils | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser( | ||
description='Search files with a specific extension under a directory', | ||
fromfile_prefix_chars='@' | ||
) | ||
parser.add_argument('--ext', required=True, help='extension to search for') | ||
parser.add_argument('directory', help='input directory') | ||
options = parser.parse_args() | ||
print('\n'.join(utils.SearchFiles(options.directory, options.ext))) | ||
|
||
if __name__ == "__main__": | ||
main() |
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