Initial commit

This commit is contained in:
vaughn committed 2026-10-08 17:18:28 -07:00
commit a450499577
5 files changed
+211

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
#!/bin/bash
#This script is designed to unpack every FreeCAD .FCStd project file into a folder in the same directory as the source file. All files in the current directory, or any subdirectories, will be processed
#take files as arguments
files=("$@")
#no arguments provided
if [ "${files}x" == "x" ]
then
#recursively find all .fcstd files in the current directory
files=$(find . -iname "*.fcstd")
fi
prev_dir="$(pwd)"
echo "${files}" | while IFS= read -r f
do
dir=$(dirname "${f}")
fn=$(basename "${f}")
name="${fn%.*}"
ext="${fn##*.}"
#only attempt this for .FCStd files
if [ "${ext,,}" == "fcstd" ]
then
#unzip into new folder in same directory as source file
cd "${dir}"
mkdir -p "${name}"
unzip -qq -d "${name}" -o "${fn}"
cd "${prev_dir}"
fi
done