Fix kcl file opening on Windows (double click) on second instance (#5420)
* WIP: Double-clicking on .kcl file on Windows redirects to the home page if the app is already open Fixes #5412 * Add deep link test case for linux * Add mac tests * Lint and win tests * Fix e2e tests * Logs everywhere * windows weird? yup * More logzzz maybe it's not windows * Remove :/// replacement. Add catch log * Fix and clean up * FIx lint * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * More lint * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Clean up tests further --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
import minimist from 'minimist'
|
||||
import yargs from 'yargs'
|
||||
import { hideBin } from 'yargs/helpers'
|
||||
|
||||
const argv = yargs(hideBin(process.argv))
|
||||
export const argvFromYargs = yargs(hideBin(process.argv))
|
||||
.option('telemetry', {
|
||||
alias: 't',
|
||||
type: 'boolean',
|
||||
@ -9,4 +10,20 @@ const argv = yargs(hideBin(process.argv))
|
||||
})
|
||||
.parse()
|
||||
|
||||
export default argv
|
||||
// TODO: find a better way to merge minimist and yargs parsers.
|
||||
|
||||
export function parseCLIArgs(argv: string[]): minimist.ParsedArgs {
|
||||
return minimist(argv, {
|
||||
// Treat all double-hyphenated arguments without equal signs as boolean
|
||||
boolean: true,
|
||||
})
|
||||
}
|
||||
|
||||
export function getPathOrUrlFromArgs(
|
||||
args: minimist.ParsedArgs
|
||||
): string | undefined {
|
||||
if (args._.length > 1) {
|
||||
return args._[1]
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user