diff options
author | Mickaël Thomas | 2017-12-15 10:53:59 +0100 |
---|---|---|
committer | Mickaël Thomas | 2017-12-15 10:53:59 +0100 |
commit | a5ccdaff4acb5de00859389707d8cfbb2cf9b820 (patch) | |
tree | ff994eaf437b80be7d4b76594ad129412e888f30 /PKGBUILD | |
parent | 70e8de093ee77fb20d3e2aa347e8771791efaabd (diff) | |
download | aur-a5ccdaff4acb5de00859389707d8cfbb2cf9b820.tar.gz |
Perform tilde expansion in user-specified path
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 |