exe path modify
This commit is contained in:
parent
960e6b766c
commit
6a6df5c8f5
1 changed files with 11 additions and 1 deletions
|
|
@ -177,12 +177,22 @@ class SchedulerManager {
|
|||
Future checkStartup() async {
|
||||
if(!await OSStartup.isRegistedStartup(startupID)) {
|
||||
List<String> param = [];
|
||||
var exe = Platform.resolvedExecutable;
|
||||
if(isDebug) {
|
||||
param.add(scriptPath);
|
||||
} else {
|
||||
//homebrew로 설치시 예외 처리
|
||||
if(exe.startsWith('/usr/local')) {
|
||||
//intel mac
|
||||
exe = '/usr/local/bin/${path.basenameWithoutExtension(exe)}';
|
||||
} else if(exe.startsWith('/opt/homebrew')) {
|
||||
//sillicon mac
|
||||
exe = '/opt/homebrew/bin/${path.basenameWithoutExtension(exe)}';
|
||||
}
|
||||
}
|
||||
param.add('scheduler');
|
||||
param.add('-s');
|
||||
await OSStartup.registStartup(Platform.resolvedExecutable, startupID, arguments: param);
|
||||
await OSStartup.registStartup(exe, startupID, arguments: param);
|
||||
}
|
||||
return simpleFuture;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue