chore
This commit is contained in:
parent
b41a2e7039
commit
e1df1bfc3f
@ -28,12 +28,12 @@ func NewApp() *App {
|
||||
// so we can call the runtime methods
|
||||
func (a *App) OnStartup(ctx context.Context) {
|
||||
a.ctx = ctx
|
||||
ex, _ := os.Executable()
|
||||
a.exDir = filepath.Dir(ex)
|
||||
a.exDir = ""
|
||||
a.cmdPrefix = ""
|
||||
|
||||
if runtime.GOOS == "darwin" {
|
||||
a.exDir += "/../../../"
|
||||
ex, _ := os.Executable()
|
||||
a.exDir = filepath.Dir(ex) + "/../../../"
|
||||
a.cmdPrefix = "cd " + a.exDir + " && "
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ func (a *App) ConvertModel(python string, modelPath string, strategy string, out
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return Cmd(python, "./backend-python/convert_model.py", "--in", modelPath, "--out", outPath, "--strategy", `"`+strategy+`"`)
|
||||
return Cmd(python, "./backend-python/convert_model.py", "--in", modelPath, "--out", outPath, "--strategy", strategy)
|
||||
}
|
||||
|
||||
func (a *App) DepCheck(python string) error {
|
||||
|
@ -46,7 +46,7 @@ func Cmd(args ...string) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
exDir := filepath.Dir(ex) + "/../../../"
|
||||
cmd := exec.Command("osascript", "-e", `tell application "Terminal" to do script "`+"cd "+exDir+" && "+strings.Join(args, " ")+`"`)
|
||||
cmd := exec.Command("osascript", "-e", `tell application 'Terminal' to do script '`+"cd "+exDir+" && "+strings.Join(args, " ")+`'`)
|
||||
err = cmd.Start()
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
@ -118,6 +118,7 @@ export const Settings: FC = observer(() => {
|
||||
<AccordionHeader ref={advancedHeaderRef} size="large">{t('Advanced')}</AccordionHeader>
|
||||
<AccordionPanel>
|
||||
<div className="flex flex-col gap-2 overflow-hidden">
|
||||
{commonStore.platform !== 'darwin' &&
|
||||
<Labeled label={t('Custom Models Path')}
|
||||
content={
|
||||
<Input className="grow" placeholder="./models" value={commonStore.settings.customModelsPath}
|
||||
@ -127,6 +128,7 @@ export const Settings: FC = observer(() => {
|
||||
});
|
||||
}} />
|
||||
} />
|
||||
}
|
||||
<Labeled label={t('Custom Python Path')}
|
||||
content={
|
||||
<Input className="grow" placeholder="./py310/python" value={commonStore.settings.customPythonPath}
|
||||
|
Loading…
Reference in New Issue
Block a user