mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
DRAFT:Add support of reading system privatekey (.ssh/id_rsa)
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
@@ -77,3 +76,14 @@ String getTime(int? unixMill) {
|
||||
String pathJoin(String path1, String path2) {
|
||||
return path1 + (path1.endsWith('/') ? '' : '/') + path2;
|
||||
}
|
||||
|
||||
String getHome() {
|
||||
String? home = "";
|
||||
Map<String, String> envVars = Platform.environment;
|
||||
if (isMacOS ||isLinux) {
|
||||
home = envVars['HOME'];
|
||||
} else if (isWindows) {
|
||||
home = envVars['UserProfile'];
|
||||
}
|
||||
return home??"";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user