mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 09:33:49 +01:00
Merge pull request #2227 from FaintSpeaker/alias-regex-not-matching-exactly
Alias command regular expression mismatch
This commit is contained in:
commit
01cb0cca81
@ -38,13 +38,14 @@ export function printAliases(): void {
|
|||||||
export function parseAliasDeclaration(dec: string, global = false): boolean {
|
export function parseAliasDeclaration(dec: string, global = false): boolean {
|
||||||
const re = /^([\w|!|%|,|@|-]+)=(("(.+)")|('(.+)'))$/;
|
const re = /^([\w|!|%|,|@|-]+)=(("(.+)")|('(.+)'))$/;
|
||||||
const matches = dec.match(re);
|
const matches = dec.match(re);
|
||||||
if (matches == null || matches.length != 3) {
|
if (matches == null || matches.length != 7) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (global) {
|
if (global) {
|
||||||
addGlobalAlias(matches[1], matches[2]);
|
addGlobalAlias(matches[1], matches[4] || matches[6]);
|
||||||
} else {
|
} else {
|
||||||
addAlias(matches[1], matches[2]);
|
addAlias(matches[1], matches[4] || matches[6]);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user