summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorMickaël Thomas2017-12-15 10:53:59 +0100
committerMickaël Thomas2017-12-15 10:53:59 +0100
commita5ccdaff4acb5de00859389707d8cfbb2cf9b820 (patch)
treeff994eaf437b80be7d4b76594ad129412e888f30 /PKGBUILD
parent70e8de093ee77fb20d3e2aa347e8771791efaabd (diff)
downloadaur-a5ccdaff4acb5de00859389707d8cfbb2cf9b820.tar.gz
Perform tilde expansion in user-specified path
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD6
1 files changed, 5 insertions, 1 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 3ab5923f697a..1905a2bfe4dd 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -96,7 +96,11 @@ _find_pkgpath_from_input() {
read -rp "Please provide the path to the directory containing ${_gamepkg} or leave blank to download it using your Factorio credentials: " pkgpath
[[ -z $pkgpath ]] && break
- # also accept a full path to the file if it has the good name
+ # perform tilde expansion
+ pkgpath="${pkgpath/#"~/"/$HOME/}"
+ [[ $pkgpath = "~" ]] && pkgpath="$HOME"
+
+ # also accept a full path to the file if it has the right name
if [[ -f $pkgpath && ${pkgpath##*/} = ${_gamepkg} ]]; then
pkgpath=${pkgpath%/*}
fi