Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate.sh for easy theme generation #1281

Merged
merged 3 commits into from
Oct 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions ownCloud/Resources/Theming/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

# PREREQUISITE
# Create symlink
# ln -s SYNCDIR\ Config\ Data/5500Z000003poZfQAI/ios/current ~/Developer/github.com/owncloud/ios-app/ownCloud/Resources/Theming/theme.damken

current_dir=$(pwd)
theming_dir="/ownCloud/Resources/Theming"
theme=$1

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a check, if the script is executed in the app repository path. Otherwise script could fail, when the current_dir is not the root of the repository path:

if [ -d "$theming_dir" ]; then
# add all lines below
fi

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds perfect 👍 I also thought about this. Could you commit in the branch?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I will do!

if [ -d "$theming_dir" ]; then
git submodule init
git submodule update

rename 's/current./theme./' $current_dir$theming_dir/*.*
mv $current_dir$theming_dir/theme.$theme $current_dir$theming_dir/current.$theme

cp $current_dir$theming_dir/current*/*.png $current_dir$theming_dir/
cp $current_dir$theming_dir/current*/*.json $current_dir$theming_dir/Branding.json

fastlane generate_appicon

gomplate --file ./tools/gomplate/Branding.plist.tmpl \
--context config=$current_dir$theming_dir/Branding.json \
--out $current_dir$theming_dir/Branding.plist
else
echo "Directory $theming_dir does not exist. Please execute this script in the root path of the ios-app repository."
fi