Added cdz check parameter for use in multicd (normal cd, squash cd and cdz).
Consolidated all squash functionality into a binary (squasher) Updated the 'cd' alias (multicd). Added -e to ldrc (to edit the user scripts)
This commit is contained in:
parent
83324dd0f7
commit
10d81b7e5b
8 changed files with 288 additions and 271 deletions
31
daisy.source
31
daisy.source
|
|
@ -80,10 +80,12 @@ LD_EDITORFILE="$LD_CONFIG_FOLDER/editor.src"
|
|||
LD_ESOURCEFILE="$LD_CONFIG_FOLDER/extra.src"
|
||||
touch $LD_ALIASFILE
|
||||
touch $LD_EDITORFILE
|
||||
touch $LD_ESOURCEFILE
|
||||
|
||||
ld_dbg echo "Sourced config contents:"
|
||||
ld_dbg cat $LD_ALIASFILE
|
||||
ld_dbg cat $LD_EDITORFILE
|
||||
ld_dbg cat $LD_ESOURCEFILE
|
||||
|
||||
# Source everything in the config folder
|
||||
function _daisy_source_configs
|
||||
|
|
@ -132,28 +134,37 @@ function daisy_wait_for_editor
|
|||
done
|
||||
}
|
||||
|
||||
function mountcd
|
||||
function multicd
|
||||
{
|
||||
cdpath="$@"
|
||||
if [[ $cdpath == '' ]];
|
||||
if [[ $cdpath == '' ]]
|
||||
then
|
||||
\cd
|
||||
return
|
||||
fi
|
||||
if [[ -f "$cdpath/.needs_mount" ]];
|
||||
|
||||
if cdz --check "$cdpath" >/dev/null 2>&1
|
||||
then
|
||||
mount-squash-image "$cdpath"
|
||||
cdz "$cdpath"
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ -f "$cdpath/.needs_mount" ]]
|
||||
then
|
||||
squasher mount "$cdpath"
|
||||
fi
|
||||
\cd "$cdpath"
|
||||
}
|
||||
|
||||
alias cd=mountcd
|
||||
alias cd=multicd
|
||||
|
||||
# Undocumented but internally used
|
||||
function daisy_editor
|
||||
{
|
||||
editor=${LD_EDITOR:-$EDITOR};
|
||||
ld_dbg echo Opening $editor to edit file: $1
|
||||
$editor "$1"
|
||||
$editor "$1"
|
||||
sleep 1
|
||||
daisy_wait_for_editor $editor "$1"
|
||||
}
|
||||
|
||||
|
|
@ -315,8 +326,12 @@ function daisy_reload
|
|||
|
||||
function ldrc
|
||||
{
|
||||
daisy_editor "$LD_SOURCE_FILE"
|
||||
LD_INTERNAL=0 source "$LD_SOURCE_FILE"
|
||||
ARG=$1
|
||||
SOURCE="$LD_SOURCE_FILE"
|
||||
[[ "$ARG" == "-e" ]] && SOURCE="$LD_ESOURCEFILE"
|
||||
|
||||
daisy_editor "$SOURCE"
|
||||
LD_INTERNAL=0 source "$SOURCE"
|
||||
}
|
||||
|
||||
enc_is_folder=0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue