This commit is contained in:
leo 2021-08-04 17:48:49 +08:00
parent 7ab2c1017a
commit d7290a9cf6

View file

@ -43,6 +43,7 @@ namespace SourceGit {
// 如果启动命令中指定了路径,打开指定目录的仓库
var launcher = new Views.Launcher();
if (Models.Preference.Instance.IsReady) {
if (e.Args.Length > 0) {
var repo = Models.Preference.Instance.FindRepository(e.Args[0]);
if (repo == null) {
@ -54,10 +55,10 @@ namespace SourceGit {
}
if (repo != null) Models.Watcher.Open(repo);
} else {
} else if (Models.Preference.Instance.Restore.IsEnabled) {
var restore = Models.Preference.Instance.Restore;
var actived = null as Models.Repository;
if (restore.IsEnabled && restore.Opened.Count > 0) {
if (restore.Opened.Count > 0) {
foreach (var path in restore.Opened) {
if (!Directory.Exists(path)) continue;
var repo = Models.Preference.Instance.FindRepository(path);
@ -68,6 +69,7 @@ namespace SourceGit {
if (actived != null) Models.Watcher.Open(actived);
}
}
}
// 主界面显示
MainWindow = launcher;