Skip to content

Commit

Permalink
Workaround for #8779.
Browse files Browse the repository at this point in the history
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
  • Loading branch information
Akos Kitta authored and kittaakos committed Nov 30, 2020
1 parent cd89fea commit 0a72196
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion dev-packages/ext-scripts/theia-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@
// @ts-check
const path = require('path');

const index = process.argv.findIndex(arg => arg.indexOf('run') !== -1);
// See: https://github.com/eclipse-theia/theia/issues/8779#issuecomment-733747340
const filter = require('os').platform() === 'win32'
? arg => arg.indexOf(path.join('ext-scripts', 'theia-run.js')) !== -1
: arg => arg.indexOf(path.join('.bin', 'run')) !== -1
let index = process.argv.findIndex(filter);
if (index === -1) {
// Fall back to the original logic.
// https://github.com/eclipse-theia/theia/blob/6ef08676314a2ceca93023ddd149579493ae7914/dev-packages/ext-scripts/theia-run.js#L21
index = process.argv.findIndex(arg => arg.indexOf('run') !== -1);
}
const args = process.argv.slice(index + 1);
const scopedArgs = args.length > 1 ? [args[0], '--scope', ...args.slice(1)] : args;
process.argv = [...process.argv.slice(0, index + 1), 'run', ...scopedArgs];
Expand Down

0 comments on commit 0a72196

Please sign in to comment.