Skip to content

Commit 30f28ed

Browse files
set an option not to delete some dir's
1 parent 70dcceb commit 30f28ed

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

udroid/src/install.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ function install_symlinks() {
1616
}
1717

1818
function create_dir() {
19-
[[ -d $1 ]] && rm -rf $1
19+
local remove=$1; shift 1
20+
[[ -n $remove ]] && [[ -d $1 ]] && rm -rf $1
2021
g_spin minidot "Creating directory \"$1\"..." mkdir -p $1
2122
}
2223

23-
create_dir $INSTALL_DIR
24+
create_dir 0 $INSTALL_DIR
2425
create_dir $DEFAULT_ROOT
2526
create_dir $DEFAULT_FS_INSTALL_DIR
2627
create_dir $DLCACHE
27-
create_dir $RTCACHE
28+
create_dir 0 $RTCACHE
2829

2930
g_spin minidot "installing $(basename $(pwd))..." cp -rv ./* $INSTALL_DIR
3031
g_spin minidot "processing symbolic link..." bash -x install_sim.sh

0 commit comments

Comments
 (0)