oto/lib/cli/commands/scheduler/scheduler_linux.dart

21 lines
626 B
Dart

// ignore_for_file: depend_on_referenced_packages
import 'dart:io';
import 'package:oto_cli/cli/commands/scheduler/scheduler_manager.dart';
import 'package:path/path.dart' as path;
class SchedulerLinux extends SchedulerManager {
@override
String get exePath {
// /home/linuxbrew/.linuxbrew/Cellar/oto/0.0.273/bin/oto
var exe = Platform.resolvedExecutable;
final key = '.linuxbrew';
if (exe.contains(key)) {
var index = exe.indexOf('.linuxbrew');
var rootPath = exe.substring(0, index);
exe = '$rootPath.linuxbrew/bin/${path.basenameWithoutExtension(exe)}';
}
return exe;
}
}