Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit da39790

Browse files
committed
- Issue #11079: The /Applications/Python x.x folder created by the Mac
OS X installers now includes a link to the installed documentation plus another in the framework share/doc directory.
1 parent eb698da commit da39790

1 file changed

Lines changed: 26 additions & 5 deletions

File tree

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,32 @@
11
#!/bin/sh
22

33
PYVER="@PYVER@"
4+
FWK="/Library/Frameworks/Python.framework/Versions/${PYVER}"
5+
FWK_DOCDIR_SUBPATH="Resources/English.lproj/Documentation"
6+
FWK_DOCDIR="${FWK}/${FWK_DOCDIR_SUBPATH}"
7+
APPDIR="/Applications/Python ${PYVER}"
8+
DEV_DOCDIR="/Developer/Documentation"
9+
SHARE_DIR="${FWK}/share"
10+
SHARE_DOCDIR="${SHARE_DIR}/doc/python${PYVER}"
11+
SHARE_DOCDIR_TO_FWK="../../.."
412

5-
if [ -d /Developer/Documentation ]; then
6-
if [ ! -d /Developer/Documentation/Python ]; then
7-
mkdir -p /Developer/Documentation/Python
8-
fi
13+
# make link in /Developer/Documentation/ for Xcode users
14+
if [ -d "${DEV_DOCDIR}" ]; then
15+
if [ ! -d "${DEV_DOCDIR}/Python" ]; then
16+
mkdir -p "${DEV_DOCDIR}/Python"
17+
fi
18+
ln -fhs "${FWK_DOCDIR}" "${DEV_DOCDIR}/Python/Reference Documentation ${PYVER}"
19+
fi
20+
21+
# make link in /Applications/Python m.n/ for Finder users
22+
if [ -d "${APPDIR}" ]; then
23+
ln -fhs "${FWK_DOCDIR}/index.html" "${APPDIR}/Python Documentation.html"
24+
fi
925

10-
ln -fhs /Library/Frameworks/Python.framework/Versions/${PYVER}/Resources/English.lproj/Documentation "/Developer/Documentation/Python/Reference Documentation @PYVER@"
26+
# make share/doc link in framework for command line users
27+
if [ -d "${SHARE_DIR}" ]; then
28+
mkdir -p "${SHARE_DOCDIR}"
29+
# make relative link to html doc directory
30+
ln -s "${SHARE_DOCDIR_TO_FWK}/${FWK_DOCDIR_SUBPATH}" "${SHARE_DOCDIR}/html"
1131
fi
32+

0 commit comments

Comments
 (0)