| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1e2f9ac commit 10005de
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -215,12 +215,20 @@ def main(): | |||
| 215 | 215 | '--directory', | |
| 216 | 216 | default=None, | |
| 217 | 217 | help='input file directory') | |
| 218 | + parser.add_argument( | ||
| 219 | + '--root', | ||
| 220 | + default=None, | ||
| 221 | + help='root directory containing the sources') | ||
| 218 | 222 | parser.add_argument('--verbose', action='store_true', help='output file') | |
| 219 | 223 | parser.add_argument('sources', nargs='*', help='input files') | |
| 220 | 224 | options = parser.parse_args() | |
| 221 | 225 | global is_verbose | |
| 222 | 226 | is_verbose = options.verbose | |
| 223 | 227 | sources = options.sources | |
| 228 | + | ||
| 229 | + if options.root is not None: | ||
| 230 | + os.chdir(options.root) | ||
| 231 | + | ||
| 224 | 232 | if options.directory is not None: | |
| 225 | 233 | js_files = utils.SearchFiles(options.directory, 'js') | |
| 226 | 234 | mjs_files = utils.SearchFiles(options.directory, 'mjs') | |
@@ -231,7 +239,8 @@ def main(): | |||
| 231 | 239 | # Should have exactly 3 types: `.js`, `.mjs` and `.gypi` | |
| 232 | 240 | assert len(source_files) == 3 | |
| 233 | 241 | # Currently config.gypi is the only `.gypi` file allowed | |
| 234 | - assert source_files['.gypi'] == ['config.gypi'] | ||
| 242 | + assert len(source_files['.gypi']) == 1 | ||
| 243 | + assert os.path.basename(source_files['.gypi'][0]) == 'config.gypi' | ||
| 235 | 244 | source_files['config.gypi'] = source_files.pop('.gypi')[0] | |
| 236 | 245 | JS2C(source_files, options.target) | |
| 237 | 246 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments