Skip to content

Commit

Permalink
added using of pdfslizeopt_libexec/python if available, to pdfsizeopt…
Browse files Browse the repository at this point in the history
… and pdfsizeopt.single shell scripts
  • Loading branch information
Peter Szabo committed Sep 3, 2017
1 parent 85cb0a2 commit 41eda80
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions mksingle.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ def MinifyPostScriptProcsets(file_name, code_orig):
# Python, otherwise you have to run it as a shell script.
#
P="$(readlink "$0" 2>/dev/null)"
test "$P" || P="$0"
P="${P%/*}"/pdfsizeopt_libexec/python
test -f "$P" && exec "$P" -- "$0" ${1+"$@"}
type python2.7 >/dev/null 2>&1 && exec python2.7 -- "$0" ${1+"$@"}
type python2.6 >/dev/null 2>&1 && exec python2.6 -- "$0" ${1+"$@"}
type python2.5 >/dev/null 2>&1 && exec python2.5 -c"import sys;del sys.argv[0];sys.path[0]=sys.argv[0];import m" "$0" ${1+"$@"}
Expand Down
6 changes: 5 additions & 1 deletion pdfsizeopt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#! /bin/sh
#!/bin/sh

""":" # pdfsizeopt: PDF file size optimizer

P="$(readlink "$0" 2>/dev/null)"
test "$P" || P="$0"
P="${P%/*}"/pdfsizeopt_libexec/python
test -f "$P" && exec "$P" -- "$0" ${1+"$@"}
type -p python2.7 >/dev/null 2>&1 && exec python2.7 -- "$0" ${1+"$@"}
type -p python2.6 >/dev/null 2>&1 && exec python2.6 -- "$0" ${1+"$@"}
type -p python2.5 >/dev/null 2>&1 && exec python2.5 -- "$0" ${1+"$@"}
Expand Down

0 comments on commit 41eda80

Please sign in to comment.