Skip to content

Commit

Permalink
⚡ Optimized Storage Writer and logs at startup.
Browse files Browse the repository at this point in the history
  • Loading branch information
omegaui committed Jan 9, 2024
1 parent acb0fb6 commit 60cab34
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
36 changes: 18 additions & 18 deletions assets/exclusion-config.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"exclusions": [
{
"name": "GitHub Token",
"pattern": "^[a-zA-Z0-9]{40}$"
},
{
"name": "Gitlab Token",
"pattern": "^[a-zA-Z0-9_-]{20,}$"
},
{
"name": "Git HTTPS Url",
"pattern": "^https:\\/\\/([^:]+):([^@]+)@([^\\/]+)\\/(.+\/[^.]+)\\.git$"
},
{
"name": "SSH Key",
"pattern": "^ssh-rsa\\s+[A-Za-z0-9+/]+[=]{0,3}(\\s+[^\\s]+)?\\s*$"
}
]
"exclusions": [
{
"name": "GitHub Token",
"pattern": "^[a-zA-Z0-9]{40}$"
},
{
"name": "Gitlab Token",
"pattern": "^[a-zA-Z0-9_-]{20,}$"
},
{
"name": "Git HTTPS Url",
"pattern": "^https:\\/\\/([^:]+):([^@]+)@([^\\/]+)\\/(.+\/[^.]+)\\.git$"
},
{
"name": "SSH Key",
"pattern": "^ssh-rsa\\s+[A-Za-z0-9+/]+[=]{0,3}(\\s+[^\\s]+)?\\s*$"
}
]
}
2 changes: 1 addition & 1 deletion lib/core/storage/storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Storage {

Storage._();

static void initSpace() async {
static Future<void> initSpace() async {
mkdir(combineHomePath(['.config', 'cliptopia']),
"Creating Cliptopia Storage Route ...");
mkdir(combineHomePath(['.config', 'cliptopia', 'bug-reports']),
Expand Down
6 changes: 3 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:cliptopia/app/powermode/presentation/power_mode_app.dart';
import 'package:cliptopia/app/welcome/presentation/welcome_dialog.dart';
import 'package:cliptopia/config/themes/app_theme.dart';
import 'package:cliptopia/core/powermode/power_utils.dart';
import 'package:cliptopia/constants/meta_info.dart';
import 'package:cliptopia/constants/usage.dart';
import 'package:cliptopia/core/app_bug_report.dart';
import 'package:cliptopia/core/argument_handler.dart';
import 'package:cliptopia/core/clipboard_engine.dart';
import 'package:cliptopia/core/powermode/power_utils.dart';
import 'package:cliptopia/core/services/injector.dart';
import 'package:cliptopia/core/services/route_service.dart';
import 'package:cliptopia/core/storage/storage.dart';
Expand All @@ -22,7 +22,7 @@ const normalSize = Size(750, 650);
var windowSize = normalSize;

void main(List<String> arguments) {
runZonedGuarded(() {
runZonedGuarded(() async {
ArgumentHandler.init(arguments);
if (!ArgumentHandler.validate()) {
final unknownOptions = ArgumentHandler.getUnknownOptions();
Expand Down Expand Up @@ -52,7 +52,7 @@ void main(List<String> arguments) {
WidgetsFlutterBinding.ensureInitialized();

// Initializing App Storage
Storage.initSpace();
await Storage.initSpace();

// Initializing Themes
AppTheme.init();
Expand Down
3 changes: 2 additions & 1 deletion linux/my_application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ int readMonitorIndex() {
const char *homeDir = getenv("HOME");
if (homeDir == NULL) {
fprintf(stderr, "Error: HOME environment variable not set.\n");
fprintf(stderr, "Please fix this or else power mode window will not open in the desired monitor.\n");
return 0;
}

Expand All @@ -32,7 +33,7 @@ int readMonitorIndex() {
// Open the file for reading
FILE *file = fopen(configFile, "r");
if (file == NULL) {
fprintf(stderr, "Error opening file: %s\n", configFile);
fprintf(stderr, "Couldn't open monitor-config file: Ignore this if this is not a multi-monitor setup\n");
return 0;
}

Expand Down

0 comments on commit 60cab34

Please sign in to comment.