Skip to content

Commit

Permalink
src/winusb: copy_filesystem_files: Fix file list feeding
Browse files Browse the repository at this point in the history
Signed-off-by: 林博仁 <[email protected]>
  • Loading branch information
brlin-tw committed Jun 5, 2017
1 parent c93ed18 commit 7e83c8b
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/winusb
Original file line number Diff line number Diff line change
Expand Up @@ -797,14 +797,6 @@ copy_filesystem_files(){

pushd "${source_fs_mountpoint}" >/dev/null

local file_list
file_list=$(\
find\
.\
-not -path "."\
-print0\
)

local -i copied_size=0 percentage; while IFS='' read -r -d '' source_file; do
dest_file="${target_fs_mountpoint}/${source_file}"

Expand Down Expand Up @@ -837,7 +829,12 @@ copy_filesystem_files(){
let "copied_size = copied_size + source_file_size" || true
let "percentage = (copied_size * 100) / total_size" || true
echo -en "${percentage}%\r"
done < <(echo "${file_list}"); unset source_file dest_file source_file_size copied_size percentage percentage
done < <(\
find\
.\
-not -path "."\
-print0\
); unset source_file dest_file source_file_size copied_size percentage percentage

popd >/dev/null

Expand Down

0 comments on commit 7e83c8b

Please sign in to comment.