Skip to content

Instantly share code, notes, and snippets.

@LeonardoCardoso
Last active October 30, 2018 09:56
Show Gist options
  • Save LeonardoCardoso/c0755fdf921e98167bb5ea61eb6e02bd to your computer and use it in GitHub Desktop.
Save LeonardoCardoso/c0755fdf921e98167bb5ea61eb6e02bd to your computer and use it in GitHub Desktop.
AndAction - Script to Generate a Nice Folder Structure for Cinematography Projects
#!/bin/bash
### Functions
trim() {
local trimmed="$1"
# Strip leading space.
trimmed="${trimmed## }"
# Strip trailing space.
trimmed="${trimmed%% }"
echo "$trimmed"
}
### Project name
printf "What's the project name? "
read -r DIR
DIR="./`date +%Y.%m.%d` - $DIR"
### Project duration
DAYS=0
while [ $DAYS -lt 1 ]
do
printf "How long did the project take (in days)? "
read -r DAYS
done
# Cameras
printf "Which cameras did you use (separated by commas)? "
read -r CAMERAS
set -- "$CAMERAS"
IFS=","; declare -a CAMS=($*)
for ((i=0; i<${#CAMS[@]}; i++));
do
CURRENT="$(trim ${CAMS[$i]})"
CAMS[$i]="$CURRENT"
done
### Action
mkdir -pv "$DIR" "$DIR/Footage" "$DIR/Graphics" "$DIR/Music" "$DIR/Project Files" "$DIR/Renders"
for ((i=0; i<$DAYS; i++));
do
for j in "${CAMS[@]}"
do
DAY=$(($i + 1))
DAY=$(printf "%03d" $DAY)
mkdir -pv "$DIR/Footage/Day $DAY/$j"
done
done
echo "Project folders created successfully"
tree $DIR
open $DIR
echo "PRO TIPS:"
echo "1 - Copy the whole content from the source, like DCIM and MISC from the camera memory cards."
echo "2 - When backing up, copy the content from original source to the back-up disks. This avoids duplication of errors."
echo "For more tips: Check it out https://www.youtube.com/watch?v=vGJwfzqsl5o"
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment