-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint
35 lines (26 loc) · 867 Bytes
/
entrypoint
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
#####################################################
# Image Optimzer Action
# Created by github.com/MarketingPipeline
#####################################################
FILEPATH=$1
RECURSION=$2
### File Path Option
if [ -z "$FILEPATH" ]
then
echo "\Image path or folder path was not specified, optimizing all image files in repo"
FILEPATH="./"
else
echo "\Image path or folder path was provided, $FILEPATH will be optimized if it exists"
FILEPATH=$FILEPATH
fi
### Overwrite files
if [ -z "$RECURSION" ]
then
echo "\RECURSION option was not chosen, optimizing all image files in $FILEPATH, without recursion"
RECURSION="-nr"
else
echo "\RECURSION option was chosen, optimizing all image files in $FILEPATH and all of its subdirectories "
RECURSION=""
fi
optimize-images $RECURSION $FILEPATH