lstat panicks if file doesnt exist
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { lstatSync, readFileSync } from 'fs'
|
||||
import { existsSync, lstatSync, readFileSync } from 'fs'
|
||||
import { BaseUrl, FileUrl, ScriptPath, SupportUrl } from './paths'
|
||||
import {
|
||||
UserScriptMeta,
|
||||
@@ -29,7 +29,7 @@ export default function (name: string): [UserScriptMetaFull, string] {
|
||||
|
||||
let metaPath = ScriptPath(name).meta
|
||||
|
||||
if (lstatSync(metaPath).isFile()) {
|
||||
if (existsSync(metaPath) && lstatSync(metaPath).isFile()) {
|
||||
try {
|
||||
let args: UserScriptMetaPartial = JSON.parse(
|
||||
readFileSync(metaPath).toString()
|
||||
|
||||
Reference in New Issue
Block a user