mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 17:11:40 -05:00
Merge pull request #2484 from Dranaxel/refactor_source
Refactorised source_quiet in src/excmd.ts
This commit is contained in:
commit
c318373bdd
1 changed files with 2 additions and 10 deletions
|
@ -781,17 +781,9 @@ export async function source(...args: string[]) {
|
|||
* Same as [[source]] but suppresses all errors
|
||||
*/
|
||||
//#background
|
||||
export async function source_quiet(...args: string[]) {
|
||||
export async function source_quiet(args: string[]) {
|
||||
try {
|
||||
if (args[0] === "--url") {
|
||||
let url = args[1]
|
||||
if (!url || url === "%") url = window.location.href
|
||||
if (!(url.startsWith("http://") || url.startsWith("https://"))) url = "http://" + url
|
||||
await rc.sourceFromUrl(url)
|
||||
} else {
|
||||
const file = args.join(" ") || undefined
|
||||
if (await Native.nativegate("0.1.3", false)) rc.source(file)
|
||||
}
|
||||
await source(...args)
|
||||
} catch (e) {
|
||||
logger.info("Automatic loading of RC file failed.")
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue