-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' of https://github.com/atsign-foundation/at_tools …
…into exception_stack_test
- Loading branch information
Showing
16 changed files
with
329 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,29 @@ | ||
import 'dart:io'; | ||
import 'dart:isolate'; | ||
|
||
import 'package:at_utils/at_utils.dart'; | ||
import 'package:yaml/yaml.dart'; | ||
import 'package:path/path.dart' as path; | ||
|
||
class ConfigUtil { | ||
static final ApplicationConfiguration appConfig = | ||
ApplicationConfiguration('config/config.yaml'); | ||
static late final ApplicationConfiguration appConfig; | ||
|
||
static Future<void> init() async { | ||
String configPath = await _getConfigFile(); | ||
appConfig = ApplicationConfiguration(configPath); | ||
} | ||
|
||
static YamlMap? getYaml() { | ||
return appConfig.getYaml(); | ||
} | ||
|
||
static Future<String> _getConfigFile() async { | ||
var fileUri = await Isolate.resolvePackageUri( | ||
Uri.parse('package:at_cli/')); | ||
if (fileUri == null) { | ||
throw Exception('Could not find package location'); | ||
} | ||
Directory packageRoot = Directory.fromUri(fileUri).parent; | ||
return path.join(packageRoot.path, 'config/config.yaml'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ enum KeyType { | |
cachedPublicKey, | ||
cachedSharedKey, | ||
reservedKey, | ||
localKey, | ||
invalidKey | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.