tomaz/appledoc — Issue #159: Install from Fabric, support for path contains whitespace
Author: koyachi
Created: 2011-12-15 05:32:12+00:00
State: open

patch:

```diff
--- /tmp/appledoc/install-appledoc.sh	2011-12-15 13:28:46.000000000 +0900
+++ ./install-appledoc.sh	2011-12-15 13:34:28.000000000 +0900
@@ -35,7 +35,7 @@
xcodebuild -target appledoc -configuration Release install

echo "Installing binary to $BINARY_DIR"
-cp /tmp/appledoc.dst/usr/local/bin/appledoc $BINARY_DIR
+cp /tmp/appledoc.dst/usr/local/bin/appledoc "$BINARY_DIR"

echo "Copying templates to $TEMPLATES_DIR"
-cp -R Templates/ $TEMPLATES_DIR
\ No newline at end of file
+cp -R Templates/ "$TEMPLATES_DIR"
\ No newline at end of file
```

example fabfile.py

```python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from fabric.api import *
import os

env.hosts = ['localhost']
home = os.environ['HOME']
install_appledoc_path = os.path.join(home, 'Library', 'Application Support', 'appledoc')
install_appledoc_home_path = os.path.join(home, '.appledoc')

# setup_appledocうまくできてないの元に戻すときに
def clean():
for path in [install_appledoc_path, install_appledoc_home_path]:
if os.path.exists(path):
local('rm -r "%s"' % path)
sudo('rm -r /tmp/appledoc')

#def patch_install_appledoc_sh(downloaded_appledoc_path):
# print('パスを"で囲むパッチあてる')
# local('patch -u %s/install-appledoc.sh < ./tools/appledoc/appledoc_install-appledoc.sh.patch' % downloaded_appledoc_path)

def setup_appledoc():
dst_dirs = [install_appledoc_path, install_appledoc_home_path]
downloaded_appledoc_path = '/tmp/appledoc'

local('git clone https://github.com/tomaz/appledoc.git %s' % downloaded_appledoc_path)
#patch_install_appledoc_sh(downloaded_appledoc_path)
for dst_dir in dst_dirs:
local('mkdir "%s"' % dst_dir)
tmp_dir = '%s' % os.path.join(downloaded_appledoc_path, 'Templates')
local('cp -pr "%s/docset" "%s/html" "%s"' % (tmp_dir, tmp_dir, dst_dir))
with cd('"%s"' % downloaded_appledoc_path):
sudo('sh install-appledoc.sh -b /usr/bin -t "%s"' % install_appledoc_path)

```