Build native Flutter Linux manager and deb release 0.2.5
This commit is contained in:
1 parent
3c6c4a0e90
commit
03e729a60b
35 files changed
+757
-69
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:path/path.dart' as p;
|
||||
|
||||
/// Stable per-user locations, independent of the installed bundle and cwd.
|
||||
class AppPaths {
|
||||
static String configuration({
|
||||
Map<String, String>? environment,
|
||||
bool? windows,
|
||||
}) {
|
||||
final env = environment ?? Platform.environment;
|
||||
final isWindows = windows ?? Platform.isWindows;
|
||||
final paths = p.Context(style: isWindows ? p.Style.windows : p.Style.posix);
|
||||
final home = env['HOME'] ?? env['USERPROFILE'] ?? Directory.systemTemp.path;
|
||||
return isWindows
|
||||
? paths.join(env['LOCALAPPDATA'] ?? home, 'TTSTD', 'ADS-Flutter')
|
||||
: paths.join(
|
||||
env['XDG_CONFIG_HOME'] ?? paths.join(home, '.config'),
|
||||
'ads-flutter',
|
||||
);
|
||||
}
|
||||
|
||||
static String logs({Map<String, String>? environment, bool? windows}) {
|
||||
final env = environment ?? Platform.environment;
|
||||
final isWindows = windows ?? Platform.isWindows;
|
||||
if (isWindows) {
|
||||
return p.Context(style: p.Style.windows)
|
||||
.join(configuration(environment: env, windows: true), 'logs');
|
||||
}
|
||||
final home = env['HOME'] ?? Directory.systemTemp.path;
|
||||
return p.posix.join(
|
||||
env['XDG_STATE_HOME'] ?? p.posix.join(home, '.local', 'state'),
|
||||
'ads-flutter',
|
||||
'logs',
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user