From e30a0302d768ecbdaa46584d1d45c8aee7eb7dbc Mon Sep 17 00:00:00 2001 From: sameu Date: Sun, 8 Oct 2023 00:24:08 +0800 Subject: [PATCH] =?UTF-8?q?fs.exists=E6=96=B9=E6=B3=95=E5=B7=B2=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E7=94=A8,=E4=BF=AE=E6=94=B9=E4=B8=BAfs.existsSync?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/gsCfg.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/model/gsCfg.js b/model/gsCfg.js index 1b3f369..1ca7c42 100644 --- a/model/gsCfg.js +++ b/model/gsCfg.js @@ -177,7 +177,7 @@ class GsCfg { if (lodash.isEmpty(data)) { fs.existsSync(file) && fs.unlinkSync(file) } else { - fs.exists(file, (exists) => { + const exists = fs.existsSync(file) if (!exists) { fs.writeFileSync(file, "", 'utf8') } @@ -195,7 +195,6 @@ class GsCfg { fs.writeFileSync(file,YAML.stringify(ck), 'utf8') } } - }) } } }