update code refactoring
This commit is contained in:
parent
ff46b25868
commit
815d07af52
3 changed files with 28 additions and 11 deletions
|
|
@ -1,3 +1,5 @@
|
|||
// ignore_for_file: depend_on_referenced_packages
|
||||
|
||||
import 'dart:collection';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
|
@ -227,14 +229,23 @@ class SchedulerManager {
|
|||
Future _startProcess() async {
|
||||
//Launchd로 자동 실행이 되지 않은경우 직접실행
|
||||
if (_currentScheduler == null) {
|
||||
var script = isDebug ? ' $scriptPath' : '';
|
||||
var shell = StringBuffer();
|
||||
shell.writeln('nohup $executablePath$script scheduler -s &');
|
||||
// shell.writeln('disown');
|
||||
print(shell.toString());
|
||||
ProcessExecutor.run(shell,
|
||||
workspace: Directory.systemTemp.path, printStdout: false);
|
||||
await _checkProcess();
|
||||
if (Platform.isWindows) {
|
||||
final program = Platform.resolvedExecutable;
|
||||
var arguments = <String>[];
|
||||
if (isDebug) arguments.add(scriptPath);
|
||||
arguments.addAll(['scheduler', '-s']);
|
||||
await Process.start(program, arguments,
|
||||
mode: ProcessStartMode.detached);
|
||||
} else {
|
||||
var script = isDebug ? ' $scriptPath' : '';
|
||||
var shell = StringBuffer();
|
||||
shell.writeln('nohup $executablePath$script scheduler -s &');
|
||||
// shell.writeln('disown');
|
||||
print(shell.toString());
|
||||
ProcessExecutor.run(shell,
|
||||
workspace: Directory.systemTemp.path, printStdout: false);
|
||||
await _checkProcess();
|
||||
}
|
||||
}
|
||||
return simpleFuture;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:oto_cli/cli/commands/scheduler/scheduler_manager.dart';
|
||||
|
||||
class SchedulerWindows extends SchedulerManager {
|
||||
|
||||
}
|
||||
@override
|
||||
String get exePath {
|
||||
var exe = Platform.resolvedExecutable;
|
||||
return exe;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,8 +126,9 @@ class Application {
|
|||
exit(10);
|
||||
}
|
||||
|
||||
if (logEnable)
|
||||
if (logEnable) {
|
||||
await printBuildStep('Build Successfully Complete', Color.cyan);
|
||||
}
|
||||
if (buildType != BuildType.scheduler) {
|
||||
exit(0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue