windows cli fixes
Signed-off-by: FTCHD <144691102+FTCHD@users.noreply.github.com>
This commit is contained in:
@@ -2,7 +2,7 @@ import { appLocalDataDir, sep } from '@tauri-apps/api/path'
|
||||
import { exists, mkdir, writeTextFile } from '@tauri-apps/plugin-fs'
|
||||
import { fetch } from '@tauri-apps/plugin-http'
|
||||
import { Command } from '@tauri-apps/plugin-shell'
|
||||
import { RCLONE_CONF_REGEX } from './constants'
|
||||
import { DOUBLE_BACKSLASH_REGEX, RCLONE_CONF_REGEX } from './constants'
|
||||
|
||||
export async function getDefaultPaths() {
|
||||
console.log('[getDefaultPaths]')
|
||||
@@ -20,12 +20,12 @@ export async function getDefaultPaths() {
|
||||
|
||||
console.log('[getDefaultPaths] json', JSON.stringify(defaultPaths, null, 2))
|
||||
|
||||
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, '\\') : '',
|
||||
cache: defaultPaths.cache ? defaultPaths.cache.replace(DOUBLE_BACKSLASH_REGEX, '\\') : '',
|
||||
config: defaultPaths.config
|
||||
? defaultPaths.config.replace(DOUBLE_BACKSLASH_REGEX, '\\')
|
||||
: '',
|
||||
temp: defaultPaths.temp ? defaultPaths.temp.replace(DOUBLE_BACKSLASH_REGEX, '\\') : '',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,3 +15,4 @@ export const RCLONE_VFS_DEFAULTS = {
|
||||
}
|
||||
|
||||
export const RCLONE_CONF_REGEX = /[\/\\]rclone\.conf$/
|
||||
export const DOUBLE_BACKSLASH_REGEX = /\\\\/g
|
||||
|
||||
@@ -177,7 +177,7 @@ async function startRclone() {
|
||||
command.addListener('close', async (event) => {
|
||||
console.log('close', event)
|
||||
|
||||
if (event.code === 1 || event.code === 143) {
|
||||
if (event.code === 143 || (platform() === 'windows' && event.code === 1)) {
|
||||
Sentry.captureException(new Error('Rclone has crashed'))
|
||||
const confirmed = await ask('Rclone has crashed', {
|
||||
title: 'Error',
|
||||
|
||||
@@ -40,6 +40,7 @@ export default function TemplatesDropdown({
|
||||
type="button"
|
||||
color="primary"
|
||||
className="min-w-fit"
|
||||
variant="shadow"
|
||||
// className="max-w-2xl gap-2"
|
||||
// data-focus-visible="false"
|
||||
>
|
||||
|
||||
+15
-8
@@ -68,6 +68,7 @@ import {
|
||||
getDefaultPaths,
|
||||
getRcloneVersion,
|
||||
} from '../../lib/rclone/common'
|
||||
import { DOUBLE_BACKSLASH_REGEX } from '../../lib/rclone/constants'
|
||||
import { usePersistedStore, useStore } from '../../lib/store'
|
||||
import { triggerTrayRebuild } from '../../lib/tray'
|
||||
import ConfigCreateDrawer from '../components/ConfigCreateDrawer'
|
||||
@@ -847,6 +848,7 @@ function RemotesSection() {
|
||||
color="primary"
|
||||
data-focus-visible="false"
|
||||
variant="shadow"
|
||||
size="lg"
|
||||
>
|
||||
Create Remote
|
||||
</Button>
|
||||
@@ -1329,12 +1331,13 @@ function AboutSection() {
|
||||
const defaultPaths = await getDefaultPaths()
|
||||
const version = await getVersion()
|
||||
const dirs = {
|
||||
home: await homeDir(),
|
||||
appLocalData: await appLocalDataDir(),
|
||||
temp: await tempDir(),
|
||||
appLog: await appLogDir(),
|
||||
download: await downloadDir(),
|
||||
appData: await appDataDir(),
|
||||
// replace ALL (not just one) double backslashes with a single backslash
|
||||
home: (await homeDir()).replace(DOUBLE_BACKSLASH_REGEX, '\\'),
|
||||
appLocalData: (await appLocalDataDir()).replace(DOUBLE_BACKSLASH_REGEX, '\\'),
|
||||
temp: (await tempDir()).replace(DOUBLE_BACKSLASH_REGEX, '\\'),
|
||||
appLog: (await appLogDir()).replace(DOUBLE_BACKSLASH_REGEX, '\\'),
|
||||
download: (await downloadDir()).replace(DOUBLE_BACKSLASH_REGEX, '\\'),
|
||||
appData: (await appDataDir()).replace(DOUBLE_BACKSLASH_REGEX, '\\'),
|
||||
}
|
||||
return {
|
||||
versions: {
|
||||
@@ -1478,12 +1481,16 @@ ${last30Lines.join('\n')}
|
||||
value={JSON.stringify(info, null, 2)}
|
||||
size="lg"
|
||||
label="Debug"
|
||||
minRows={39}
|
||||
maxRows={39}
|
||||
minRows={40}
|
||||
maxRows={40}
|
||||
disableAutosize={false}
|
||||
isReadOnly={false}
|
||||
variant="faded"
|
||||
className="pb-10"
|
||||
autoCapitalize="false"
|
||||
autoComplete="false"
|
||||
autoCorrect="false"
|
||||
spellCheck="false"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user