From 8d726656dc8592b7bfc46bfc106b6a132dcda51a Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 20 May 2024 15:15:08 +0800 Subject: [PATCH] feature: supports to open repository directly from commandline on Linux --- build/build.linux.sh | 0 build/resources/_common/usr/bin/sourcegit | 2 +- src/ViewModels/Launcher.cs | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 build/build.linux.sh diff --git a/build/build.linux.sh b/build/build.linux.sh old mode 100644 new mode 100755 diff --git a/build/resources/_common/usr/bin/sourcegit b/build/resources/_common/usr/bin/sourcegit index f056d708..74670167 100644 --- a/build/resources/_common/usr/bin/sourcegit +++ b/build/resources/_common/usr/bin/sourcegit @@ -1,2 +1,2 @@ #!/bin/bash -exec /opt/sourcegit/sourcegit +exec /opt/sourcegit/sourcegit $1 diff --git a/src/ViewModels/Launcher.cs b/src/ViewModels/Launcher.cs index c2e57b49..bf3ff28d 100644 --- a/src/ViewModels/Launcher.cs +++ b/src/ViewModels/Launcher.cs @@ -35,14 +35,14 @@ namespace SourceGit.ViewModels var commandlines = Environment.GetCommandLineArgs(); if (commandlines.Length == 2) { - var path = commandlines[1].Replace('\\', '/'); + var path = commandlines[1]; var root = new Commands.QueryRepositoryRootPath(path).Result(); if (string.IsNullOrEmpty(root)) { Pages[0].Notifications.Add(new Models.Notification { IsError = true, - Message = $"Given path: '{commandlines[1]}' is NOT a valid repository!" + Message = $"Given path: '{path}' is NOT a valid repository!" }); return; }