Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F61844841
bamc_projects.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, May 9, 08:07
Size
702 B
Mime Type
text/x-shellscript
Expires
Sat, May 11, 08:07 (2 d)
Engine
blob
Format
Raw Data
Handle
17536287
Attached To
R1066 amc-cape
bamc_projects.sh
View Options
#!/bin/bash
function action_clean() {
local exam=$1
assert_exam $exam
if [ $? -eq 1 ]; then return 1; fi
verbose "Cleaning '$exam' in workspace '$DIR_WORKSPACE'..."
confirm "Clean project and outputs for exam '$exam' ?"
if [ $? -eq 0 ]; then return 0; fi
for dir in $(echo $DIR_PROJECTS $DIR_SAMPLES $DIR_BLANKS $DIR_PDFS $DIR_LISTS); do
if [ -d "$DIR_WORKSPACE/$dir/$exam" ]; then
rm -rf "$DIR_WORKSPACE/$dir/$exam/"
else
rm -rf $DIR_WORKSPACE/$dir/$exam*
fi
if [ -d "$DIR_WORKSPACE/$dir" ]; then
if [ $(ls -1A $DIR_WORKSPACE/$dir/ | wc -l) -eq 0 ]; then
verbose "Removing now empty directory: '$dir'"
rmdir $DIR_WORKSPACE/$dir/
fi
fi
done
return 0
}
# EOF
Event Timeline
Log In to Comment