Skip to content

Commit

Permalink
feat: update bash PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
sparanoid committed Oct 17, 2014
1 parent 013d344 commit 2e09915
Show file tree
Hide file tree
Showing 15 changed files with 117 additions and 101 deletions.
Binary file modified Compress Images.workflow/Contents/QuickLook/Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 21 additions & 21 deletions Compress Images.workflow/Contents/document.wflow
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
<key>isViewVisible</key>
<true/>
<key>location</key>
<string>309.500000:792.000000</string>
<string>345.000000:800.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Set Value of Variable.action/Contents/Resources/Base.lproj/main.nib</string>
</dict>
Expand Down Expand Up @@ -294,7 +294,7 @@
<key>isViewVisible</key>
<true/>
<key>location</key>
<string>309.500000:688.000000</string>
<string>345.000000:696.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Get Value of Variable.action/Contents/Resources/Base.lproj/main.nib</string>
</dict>
Expand Down Expand Up @@ -350,31 +350,31 @@
<key>ActionParameters</key>
<dict>
<key>COMMAND_STRING</key>
<string>PATH=$PATH:/usr/local/bin
<string>export PATH=/usr/local/bin:/usr/local/sbin:$PATH

for f in "$@"; do
if [ -d $f ]; then
echo "TODO: nothing to compress now!"
elif [[ $f == *.png ]]; then
if [ -f "/usr/local/bin/optipng" ]; then
/usr/local/bin/optipng -o7 "$f"
if hash optipng 2&gt;/dev/null; then
optipng -o7 "$f"
else
echo "No OptiPNG installed, skipped."
fi
if [ -f "/usr/local/bin/pngcrush" ]; then
/usr/local/bin/pngcrush -brute -reduce -ow "$f"
if hash pngcrush 2&gt;/dev/null; then
pngcrush -brute -reduce -ow "$f"
else
echo "No Pngcrush installed, skipped."
fi
elif [[ $f == *.jpg ]]; then
if [ -f "/usr/local/bin/jpegoptim" ]; then
/usr/local/bin/jpegoptim "$f" --strip-all --force --all-progressive
if hash jpegoptim 2&gt;/dev/null; then
jpegoptim "$f" --strip-all --force --all-progressive
else
echo "No jpegoptim installed, skipped."
fi
elif [[ $f == *.svg ]]; then
if [ -f "/usr/local/share/npm/bin/svgo" ]; then
/usr/local/share/npm/bin/svgo "$f"
if hash svgo 2&gt;/dev/null; then
svgo "$f"
else
echo "No SVGO installed, skipped."
fi
Expand Down Expand Up @@ -497,7 +497,7 @@ done;
<key>isViewVisible</key>
<true/>
<key>location</key>
<string>309.500000:585.000000</string>
<string>345.000000:593.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Run Shell Script.action/Contents/Resources/English.lproj/main.nib</string>
</dict>
Expand All @@ -507,27 +507,27 @@ done;
</array>
<key>connectors</key>
<dict>
<key>37FB60D1-8FFA-41E8-9634-E7A947E606F1</key>
<dict>
<key>from</key>
<string>182A2489-E9F1-46BF-AC39-72829EF82D8C - 182A2489-E9F1-46BF-AC39-72829EF82D8C</string>
<key>to</key>
<string>A11D77B6-4B2D-4990-9AFB-6E0BBC145375 - A11D77B6-4B2D-4990-9AFB-6E0BBC145375</string>
</dict>
<key>92E34750-EE88-4E58-8843-B9162876F194</key>
<key>54178172-A177-484E-B1EA-6AAAB00A901F</key>
<dict>
<key>from</key>
<string>A11D77B6-4B2D-4990-9AFB-6E0BBC145375 - A11D77B6-4B2D-4990-9AFB-6E0BBC145375</string>
<key>to</key>
<string>CFB0951C-1076-4028-92A0-490967D87A87 - CFB0951C-1076-4028-92A0-490967D87A87</string>
</dict>
<key>A5C75FDA-854D-45C3-8942-9AA3848BD6A9</key>
<key>758E6F67-7F95-402E-A9F7-D9029462DAE5</key>
<dict>
<key>from</key>
<string>373E06E1-FEF9-4E70-9172-4F8ADA9D86BE - 373E06E1-FEF9-4E70-9172-4F8ADA9D86BE</string>
<key>to</key>
<string>182A2489-E9F1-46BF-AC39-72829EF82D8C - 182A2489-E9F1-46BF-AC39-72829EF82D8C</string>
</dict>
<key>DB8C2F0A-C427-4DC9-8C77-A5CBF90F69D4</key>
<dict>
<key>from</key>
<string>182A2489-E9F1-46BF-AC39-72829EF82D8C - 182A2489-E9F1-46BF-AC39-72829EF82D8C</string>
<key>to</key>
<string>A11D77B6-4B2D-4990-9AFB-6E0BBC145375 - A11D77B6-4B2D-4990-9AFB-6E0BBC145375</string>
</dict>
</dict>
<key>variables</key>
<array>
Expand Down
2 changes: 1 addition & 1 deletion Compress JPEG.workflow/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<key>NSMenuItem</key>
<dict>
<key>default</key>
<string>Compress JPEG with jpegoptim</string>
<string>Compress JPEG</string>
</dict>
<key>NSMessage</key>
<string>runWorkflowAsService</string>
Expand Down
Binary file modified Compress JPEG.workflow/Contents/QuickLook/Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 26 additions & 20 deletions Compress JPEG.workflow/Contents/document.wflow
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<plist version="1.0">
<dict>
<key>AMApplicationBuild</key>
<string>346</string>
<string>381</string>
<key>AMApplicationVersion</key>
<string>2.3</string>
<string>2.4</string>
<key>AMDocumentVersion</key>
<string>2</string>
<key>actions</key>
Expand Down Expand Up @@ -182,9 +182,9 @@
<key>isViewVisible</key>
<true/>
<key>location</key>
<string>343.500000:498.000000</string>
<string>345.000000:488.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Set Value of Variable.action/Contents/Resources/English.lproj/main.nib</string>
<string>/System/Library/Automator/Set Value of Variable.action/Contents/Resources/Base.lproj/main.nib</string>
</dict>
<key>isViewVisible</key>
<true/>
Expand Down Expand Up @@ -294,9 +294,9 @@
<key>isViewVisible</key>
<true/>
<key>location</key>
<string>343.500000:393.000000</string>
<string>345.000000:384.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Get Value of Variable.action/Contents/Resources/English.lproj/main.nib</string>
<string>/System/Library/Automator/Get Value of Variable.action/Contents/Resources/Base.lproj/main.nib</string>
</dict>
<key>isViewVisible</key>
<true/>
Expand Down Expand Up @@ -350,10 +350,16 @@
<key>ActionParameters</key>
<dict>
<key>COMMAND_STRING</key>
<string>PATH=$PATH:/usr/local/bin
for f in "$@"; do
/usr/local/bin/jpegoptim "$f" --strip-all --force --all-progressive
done;</string>
<string>export PATH=/usr/local/bin:/usr/local/sbin:$PATH

if hash jpegoptim 2&gt;/dev/null; then
for f in "$@"; do
jpegoptim "$f" --strip-all --force --all-progressive
done;
else
echo "No jpegoptim installed, skipped."
fi
</string>
<key>CheckedForUserDefaultShell</key>
<true/>
<key>inputMethod</key>
Expand Down Expand Up @@ -468,7 +474,7 @@ done;</string>
<key>isViewVisible</key>
<true/>
<key>location</key>
<string>343.500000:290.000000</string>
<string>345.000000:281.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Run Shell Script.action/Contents/Resources/English.lproj/main.nib</string>
</dict>
Expand All @@ -478,26 +484,26 @@ done;</string>
</array>
<key>connectors</key>
<dict>
<key>2877C28C-9763-4C85-B643-685930B54C0E</key>
<key>86081216-19C7-4FBB-A8AD-5267BDCF7EB8</key>
<dict>
<key>from</key>
<string>A11D77B6-4B2D-4990-9AFB-6E0BBC145375 - A11D77B6-4B2D-4990-9AFB-6E0BBC145375</string>
<string>182A2489-E9F1-46BF-AC39-72829EF82D8C - 182A2489-E9F1-46BF-AC39-72829EF82D8C</string>
<key>to</key>
<string>CFB0951C-1076-4028-92A0-490967D87A87 - CFB0951C-1076-4028-92A0-490967D87A87</string>
<string>A11D77B6-4B2D-4990-9AFB-6E0BBC145375 - A11D77B6-4B2D-4990-9AFB-6E0BBC145375</string>
</dict>
<key>5B9C94F3-757F-4A01-A16C-24DB00DC34F2</key>
<key>9C1C4A82-2D95-4FF4-ACC3-2AD4D951E1E3</key>
<dict>
<key>from</key>
<string>373E06E1-FEF9-4E70-9172-4F8ADA9D86BE - 373E06E1-FEF9-4E70-9172-4F8ADA9D86BE</string>
<string>A11D77B6-4B2D-4990-9AFB-6E0BBC145375 - A11D77B6-4B2D-4990-9AFB-6E0BBC145375</string>
<key>to</key>
<string>182A2489-E9F1-46BF-AC39-72829EF82D8C - 182A2489-E9F1-46BF-AC39-72829EF82D8C</string>
<string>CFB0951C-1076-4028-92A0-490967D87A87 - CFB0951C-1076-4028-92A0-490967D87A87</string>
</dict>
<key>EBEFA3B6-9B38-4568-86AA-B066234D6732</key>
<key>D5FFECBB-DE5D-43CA-AAEE-776B602F721E</key>
<dict>
<key>from</key>
<string>182A2489-E9F1-46BF-AC39-72829EF82D8C - 182A2489-E9F1-46BF-AC39-72829EF82D8C</string>
<string>373E06E1-FEF9-4E70-9172-4F8ADA9D86BE - 373E06E1-FEF9-4E70-9172-4F8ADA9D86BE</string>
<key>to</key>
<string>A11D77B6-4B2D-4990-9AFB-6E0BBC145375 - A11D77B6-4B2D-4990-9AFB-6E0BBC145375</string>
<string>182A2489-E9F1-46BF-AC39-72829EF82D8C - 182A2489-E9F1-46BF-AC39-72829EF82D8C</string>
</dict>
</dict>
<key>variables</key>
Expand Down
2 changes: 1 addition & 1 deletion Compress PNG.workflow/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<key>NSMenuItem</key>
<dict>
<key>default</key>
<string>Compress PNG with OptiPNG and Pngcrush</string>
<string>Compress PNG</string>
</dict>
<key>NSMessage</key>
<string>runWorkflowAsService</string>
Expand Down
Binary file modified Compress PNG.workflow/Contents/QuickLook/Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 21 additions & 17 deletions Compress PNG.workflow/Contents/document.wflow
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
<key>isViewVisible</key>
<true/>
<key>location</key>
<string>309.500000:488.000000</string>
<string>345.000000:491.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Set Value of Variable.action/Contents/Resources/Base.lproj/main.nib</string>
</dict>
Expand Down Expand Up @@ -225,11 +225,9 @@
<dict>
<key>Container</key>
<string>List</string>
<key>Optional</key>
<true/>
<key>Types</key>
<array>
<string>com.apple.cocoa.string</string>
<string>*</string>
</array>
</dict>
<key>AMRequiredResources</key>
Expand Down Expand Up @@ -296,7 +294,7 @@
<key>isViewVisible</key>
<true/>
<key>location</key>
<string>309.500000:384.000000</string>
<string>345.000000:387.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Get Value of Variable.action/Contents/Resources/Base.lproj/main.nib</string>
</dict>
Expand Down Expand Up @@ -352,10 +350,16 @@
<key>ActionParameters</key>
<dict>
<key>COMMAND_STRING</key>
<string>PATH=$PATH:/usr/local/bin
for f in "$@"; do
/usr/local/bin/optipng -o7 "$f" &amp;&amp; /usr/local/bin/pngcrush -brute -reduce -ow "$f"
done;</string>
<string>export PATH=/usr/local/bin:/usr/local/sbin:$PATH

if hash pngcrush 2&gt;/dev/null; then
for f in "$@"; do
optipng -o7 "$f" &amp;&amp; pngcrush -brute -reduce -ow "$f"
done;
else
echo "No pngcrush installed, skipped."
fi
</string>
<key>CheckedForUserDefaultShell</key>
<true/>
<key>inputMethod</key>
Expand Down Expand Up @@ -470,7 +474,7 @@ done;</string>
<key>isViewVisible</key>
<true/>
<key>location</key>
<string>309.500000:281.000000</string>
<string>345.000000:284.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Run Shell Script.action/Contents/Resources/English.lproj/main.nib</string>
</dict>
Expand All @@ -480,26 +484,26 @@ done;</string>
</array>
<key>connectors</key>
<dict>
<key>2C2C5B2F-AC70-4FEC-8FC4-DB8626BC270E</key>
<key>806781FD-1271-4F85-84B0-EC039C8EB42C</key>
<dict>
<key>from</key>
<string>373E06E1-FEF9-4E70-9172-4F8ADA9D86BE - 373E06E1-FEF9-4E70-9172-4F8ADA9D86BE</string>
<key>to</key>
<string>182A2489-E9F1-46BF-AC39-72829EF82D8C - 182A2489-E9F1-46BF-AC39-72829EF82D8C</string>
</dict>
<key>3E3243C2-2AD2-4BFA-8E6B-9054767600CA</key>
<key>E9E334AF-E7D3-4E68-8C3B-DBB8688EBCF6</key>
<dict>
<key>from</key>
<string>182A2489-E9F1-46BF-AC39-72829EF82D8C - 182A2489-E9F1-46BF-AC39-72829EF82D8C</string>
<key>to</key>
<string>A11D77B6-4B2D-4990-9AFB-6E0BBC145375 - A11D77B6-4B2D-4990-9AFB-6E0BBC145375</string>
<key>to</key>
<string>CFB0951C-1076-4028-92A0-490967D87A87 - CFB0951C-1076-4028-92A0-490967D87A87</string>
</dict>
<key>496F31B3-CD7A-4FE1-A192-18FDAAB98B1E</key>
<key>F3DBD138-1D9E-4A2A-A0B7-62B55E31D64C</key>
<dict>
<key>from</key>
<string>A11D77B6-4B2D-4990-9AFB-6E0BBC145375 - A11D77B6-4B2D-4990-9AFB-6E0BBC145375</string>
<string>182A2489-E9F1-46BF-AC39-72829EF82D8C - 182A2489-E9F1-46BF-AC39-72829EF82D8C</string>
<key>to</key>
<string>CFB0951C-1076-4028-92A0-490967D87A87 - CFB0951C-1076-4028-92A0-490967D87A87</string>
<string>A11D77B6-4B2D-4990-9AFB-6E0BBC145375 - A11D77B6-4B2D-4990-9AFB-6E0BBC145375</string>
</dict>
</dict>
<key>variables</key>
Expand Down
2 changes: 1 addition & 1 deletion Compress SVG.workflow/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<key>NSMenuItem</key>
<dict>
<key>default</key>
<string>Compress SVG with SVGO</string>
<string>Compress SVG</string>
</dict>
<key>NSMessage</key>
<string>runWorkflowAsService</string>
Expand Down
Binary file modified Compress SVG.workflow/Contents/QuickLook/Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2e09915

Please sign in to comment.