mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[internal] add auto detection of 'git commit --amend'
* Finally! * Also improve UPX compression
This commit is contained in:
parent
9815a18009
commit
63555cd04d
7 changed files with 33 additions and 11 deletions
20
_detect-amend.sh
Normal file
20
_detect-amend.sh
Normal file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# This script detects whether git commit is being executed in amend or regular mode
|
||||
# Needed to determine whether the build number should be incremented or not.
|
||||
#
|
||||
|
||||
# Need to figure out if we are running on Windows or *NIX
|
||||
if [ "$(uname -o)" = "Msys" ]; then
|
||||
type -P wmic &>/dev/null || { echo "wmic command not found. Aborting." >&2; exit 1; }
|
||||
type -P grep &>/dev/null || { echo "grep command not found. Aborting." >&2; exit 1; }
|
||||
if $(wmic path win32_process get CommandLine | grep git.exe | grep -q -- --amend); then
|
||||
echo AMEND detected
|
||||
touch ./.amend
|
||||
fi
|
||||
else
|
||||
if $(ps -fp $PPID | grep -q -- --amend); then
|
||||
echo AMEND detected
|
||||
touch ./.amend
|
||||
fi
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue