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