This repository was archived by the owner on May 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,12 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
44} ;
55Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
66const os_1 = __importDefault ( require ( "os" ) ) ;
7+ const fs_extra_1 = __importDefault ( require ( "fs-extra" ) ) ;
78const lowdb_1 = __importDefault ( require ( "lowdb" ) ) ;
89const path_1 = __importDefault ( require ( "path" ) ) ;
910const FileSync_1 = __importDefault ( require ( "lowdb/adapters/FileSync" ) ) ;
1011const xdg_basedir_1 = __importDefault ( require ( "xdg-basedir" ) ) ;
1112const configDir = xdg_basedir_1 . default . config || path_1 . default . join ( os_1 . default . tmpdir ( ) , '.config' ) ;
1213const cloudbaseConfigDir = path_1 . default . join ( configDir , '.cloudbase' ) ;
14+ fs_extra_1 . default . ensureDirSync ( cloudbaseConfigDir ) ;
1315function getAuthDB ( ) {
1416 const dbPath = path_1 . default . join ( cloudbaseConfigDir , 'auth.json' ) ;
1517 const adapter = new FileSync_1 . default ( dbPath ) ;
Original file line number Diff line number Diff line change 11import os from 'os'
2+ import fse from 'fs-extra'
23import low from 'lowdb'
34import path from 'path'
45import FileSync from 'lowdb/adapters/FileSync'
@@ -9,6 +10,9 @@ const configDir = xdgBasedir.config || path.join(os.tmpdir(), '.config')
910// cloudbase 配置目录
1011const cloudbaseConfigDir = path . join ( configDir , '.cloudbase' )
1112
13+ // 确保目录存在
14+ fse . ensureDirSync ( cloudbaseConfigDir )
15+
1216export function getAuthDB ( ) {
1317 const dbPath = path . join ( cloudbaseConfigDir , 'auth.json' )
1418 const adapter = new FileSync ( dbPath )
You can’t perform that action at this time.
0 commit comments