utiliser le profil Common par défaut

This commit is contained in:
Jephté Clain 2018-02-07 12:32:46 +04:00
parent 6f6fc747e2
commit 9a37329cc1
1 changed files with 11 additions and 1 deletions

10
pff
View File

@ -199,6 +199,7 @@ supportées sont:
# pfile: le chemin absolu du fichier dans le projet
# rfile: le chemin relatif du fichier dans le projet
# bfile: le chemin absolu du fichier dans pff/Base/
# Cfile: le chemin absolu du fichier dans pff/Common/
# cfile: le chemin absolu du fichier dans pff/Current/
# Pfile: le chemin absolu du fichier dans pff/ANYPROFILE/
# plink: la destination du lien pfile
@ -312,6 +313,7 @@ function get_pfile() {
echo "$pffdir/pff/$profile/$pfile"
}
function get_bfile() { get_pfile "$1" Base "$2"; }
function get_Cfile() { get_pfile "$1" Common "$2"; }
function get_cfile() { get_pfile "$1" Current "$2"; }
function get_vlfiles() {
@ -374,6 +376,8 @@ function select_profile() {
src="$pffdir/pff/Current/$lfile"
if [ -f "$pffdir/pff/$profile/$lfile" ]; then
dest="$profile/$lfile"
elif [ "$profile" != Common -a -f "$pffdir/pff/Common/$lfile" ]; then
dest="Common/$lfile"
else
dest="Base/$lfile"
fi
@ -880,8 +884,14 @@ function add_local__link() {
setx Pfile=get_pfile "$pfile" "$profile" "$pffdir"
[ -e "$Pfile" ] && return 0
# créer le fichier local
setx Cfile=get_Cfile "$pfile" "$pffdir"
mkdirof "$Pfile"
if [ -e "$Cfile" ]; then
# copier depuis le profil Common par défaut
cp "$Cfile" "$Pfile"
else
cp "$bfile" "$Pfile"
fi
# mettre à jour le profil courant
setx cfile=get_cfile "$pfile" "$pffdir"
setx clink=multiups "Current/$rfile" "$profile/$rfile"