mirror of https://github.com/CIRCL/Circlean
support files with spaces
parent
dcdbfb5401
commit
feb05cc5ab
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
#set -e
|
||||||
#set -x
|
set -x
|
||||||
|
|
||||||
source ./constraint.sh
|
source ./constraint.sh
|
||||||
source ./constraint_conv.sh
|
source ./constraint_conv.sh
|
||||||
|
@ -149,13 +149,14 @@ main(){
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FILE_COMMAND='file -b --mime-type'
|
|
||||||
FILE_LIST=`find ${CURRENT_SRC} -type f`
|
FILE_LIST=`find ${CURRENT_SRC} -type f`
|
||||||
|
SAVEIFS=$IFS
|
||||||
|
IFS=$(echo -en "\n\b")
|
||||||
for file in ${FILE_LIST}; do
|
for file in ${FILE_LIST}; do
|
||||||
# first param is the destination dir
|
# first param is the destination dir
|
||||||
dest=${1}
|
dest=${1}
|
||||||
|
|
||||||
mime=`$FILE_COMMAND ${file}`
|
mime=`file -b --mime-type ${file}`
|
||||||
echo ${mime}
|
echo ${mime}
|
||||||
main_mime=`echo ${mime} | cut -f1 -d/`
|
main_mime=`echo ${mime} | cut -f1 -d/`
|
||||||
details=`echo ${mime} | cut -f2 -d/`
|
details=`echo ${mime} | cut -f2 -d/`
|
||||||
|
@ -193,5 +194,6 @@ main(){
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
IFS=$SAVEIFS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue