fix & logs for writeFile error
Signed-off-by: FTCHD <144691102+FTCHD@users.noreply.github.com>
This commit is contained in:
@@ -19,7 +19,13 @@ export async function getDefaultPaths() {
|
||||
|
||||
console.log('[getDefaultPaths] json', JSON.stringify(defaultPaths, null, 2))
|
||||
|
||||
return defaultPaths
|
||||
const doubleBackslashRegex = /\\/g
|
||||
|
||||
return {
|
||||
cache: defaultPaths.cache ? defaultPaths.cache.replace(doubleBackslashRegex, '/') : '',
|
||||
config: defaultPaths.config ? defaultPaths.config.replace(doubleBackslashRegex, '/') : '',
|
||||
temp: defaultPaths.temp ? defaultPaths.temp.replace(doubleBackslashRegex, '/') : '',
|
||||
}
|
||||
}
|
||||
|
||||
export async function getDefaultPath(type: 'system' | 'internal') {
|
||||
|
||||
+4
-1
@@ -39,10 +39,13 @@ export async function initRclone(args: string[]) {
|
||||
let activeConfigFile = state.activeConfigFile
|
||||
const defaultPath = await getDefaultPath(system ? 'system' : 'internal')
|
||||
|
||||
console.log('[initRclone] defaultPath', defaultPath)
|
||||
|
||||
if (system) {
|
||||
const hasConfig = await exists(defaultPath).catch(() => false)
|
||||
if (!hasConfig) {
|
||||
await writeFile(defaultPath, new Uint8Array())
|
||||
// const data = new Uint8Array([32]) // ASCII code for space character
|
||||
await writeFile(defaultPath, new Uint8Array([]))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user