mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-21 05:10:25 +08:00
fix: getting askpass for every action even when it's not necessary (#1577)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
[Desktop Entry]
|
||||
Name=SourceGit
|
||||
Comment=Open-source & Free Git GUI Client
|
||||
Exec=/opt/sourcegit/sourcegit
|
||||
Exec=/usr/bin/sourcegit
|
||||
Icon=/usr/share/icons/sourcegit.png
|
||||
Terminal=false
|
||||
Type=Application
|
||||
|
||||
4
build/resources/_common/sourcegit
Normal file
4
build/resources/_common/sourcegit
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
eval `ssh-agent -s`
|
||||
/opt/sourcegit/sourcegit $@
|
||||
4
build/resources/appimage/sourcegit
Normal file
4
build/resources/appimage/sourcegit
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
eval `ssh-agent -s`
|
||||
"$APPDIR/opt/sourcegit/sourcegit" $@
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 37 KiB |
@@ -21,11 +21,12 @@ mkdir -p %{buildroot}/%{_bindir}
|
||||
mkdir -p %{buildroot}/usr/share/applications
|
||||
mkdir -p %{buildroot}/usr/share/icons
|
||||
cp -f ../../../SourceGit/* %{buildroot}/opt/sourcegit/
|
||||
ln -rsf %{buildroot}/opt/sourcegit/sourcegit %{buildroot}/%{_bindir}
|
||||
cp -f ../../_common/sourcegit %{buildroot}/%{_bindir}
|
||||
cp -r ../../_common/applications %{buildroot}/%{_datadir}
|
||||
cp -r ../../_common/icons %{buildroot}/%{_datadir}
|
||||
chmod 755 -R %{buildroot}/opt/sourcegit
|
||||
chmod 755 %{buildroot}/%{_datadir}/applications/sourcegit.desktop
|
||||
chmod 755 %{buildroot}/%{_bindir}/sourcegit
|
||||
|
||||
%files
|
||||
%dir /opt/sourcegit/
|
||||
|
||||
@@ -41,8 +41,9 @@ cp -r SourceGit SourceGit.AppDir/opt/sourcegit
|
||||
desktop-file-install resources/_common/applications/sourcegit.desktop --dir SourceGit.AppDir/usr/share/applications \
|
||||
--set-icon com.sourcegit_scm.SourceGit --set-key=Exec --set-value=AppRun
|
||||
mv SourceGit.AppDir/usr/share/applications/{sourcegit,com.sourcegit_scm.SourceGit}.desktop
|
||||
cp resources/appimage/sourcegit.png SourceGit.AppDir/com.sourcegit_scm.SourceGit.png
|
||||
ln -rsf SourceGit.AppDir/opt/sourcegit/sourcegit SourceGit.AppDir/AppRun
|
||||
cp resources/_common/icons/sourcegit.png SourceGit.AppDir/com.sourcegit_scm.SourceGit.png
|
||||
cp -f resources/appimage/sourcegit SourceGit.AppDir/AppRun
|
||||
chmod 755 SourceGit.AppDir/AppRun
|
||||
ln -rsf SourceGit.AppDir/usr/share/applications/com.sourcegit_scm.SourceGit.desktop SourceGit.AppDir
|
||||
cp resources/appimage/sourcegit.appdata.xml SourceGit.AppDir/usr/share/metainfo/com.sourcegit_scm.SourceGit.appdata.xml
|
||||
|
||||
@@ -53,9 +54,10 @@ mkdir -p resources/deb/usr/bin
|
||||
mkdir -p resources/deb/usr/share/applications
|
||||
mkdir -p resources/deb/usr/share/icons
|
||||
cp -f SourceGit/* resources/deb/opt/sourcegit
|
||||
ln -rsf resources/deb/opt/sourcegit/sourcegit resources/deb/usr/bin
|
||||
cp -f resources/_common/sourcegit resources/deb/usr/bin/
|
||||
cp -r resources/_common/applications resources/deb/usr/share
|
||||
cp -r resources/_common/icons resources/deb/usr/share
|
||||
chmod 755 resources/deb/usr/bin/sourcegit
|
||||
# Calculate installed size in KB
|
||||
installed_size=$(du -sk resources/deb | cut -f1)
|
||||
# Update the control file
|
||||
|
||||
@@ -172,7 +172,7 @@ namespace SourceGit.Commands
|
||||
|
||||
// If an SSH private key was provided, sets the environment.
|
||||
if (!start.Environment.ContainsKey("GIT_SSH_COMMAND") && !string.IsNullOrEmpty(SSHKey))
|
||||
start.Environment.Add("GIT_SSH_COMMAND", $"ssh -i '{SSHKey}'");
|
||||
start.Environment.Add("GIT_SSH_COMMAND", $"ssh -o AddKeysToAgent=yes -i {SSHKey.Quoted()}");
|
||||
|
||||
// Force using en_US.UTF-8 locale
|
||||
if (OperatingSystem.IsLinux())
|
||||
|
||||
Reference in New Issue
Block a user