Skip to content

Commit f6093db

Browse files
committed
fix(deisctl): refresh-units uses $HOME/.deis/units by default
1 parent d8228df commit f6093db

4 files changed

Lines changed: 17 additions & 6 deletions

File tree

contrib/coreos/user-data

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ coreos:
5050

5151
[Service]
5252
Type=oneshot
53-
ExecStart=/usr/bin/sh -c 'curl -sSL http://deis.io/deisctl/install.sh | sh'
53+
ExecStart=/usr/bin/sh -c 'curl -sSL http://deis.io/deisctl/install.sh | sh -s 0.13.0-dev'
5454
write_files:
5555
- path: /etc/deis-release
5656
content: |

deisctl/Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@ build:
1010
installer:
1111
rm -rf dist && mkdir -p dist
1212
CGO_ENABLED=0 godep go build -a -ldflags '-s' -o dist/deisctl .
13-
@if [ ! -d makeself ]; then git clone -b deisctl-hack https://github.com/deis/makeself.git; fi
14-
PATH=./makeself:$$PATH makeself.sh --bzip2 --nox11 --target /usr/local/bin dist \
13+
@if [ ! -d makeself ]; then git clone -b single-binary https://github.com/deis/makeself.git; fi
14+
PATH=./makeself:$$PATH BINARY=deisctl makeself.sh --bzip2 --current --nox11 dist \
1515
dist/deisctl-`cat deis-version`-`go env GOOS`-`go env GOARCH`.run "Deis Control Utility" \
16-
"deisctl refresh-units && chmod 755 /var/lib/deis /var/lib/deis/units && chmod -R 644 /var/lib/deis/units/*"
16+
"./deisctl refresh-units \
17+
&& echo \
18+
&& echo '\033[0;36mdeisctl\033[0m is in the current directory and unit files are' \
19+
&& echo 'in $$HOME/.deis/units. Please move \033[0;36mdeisctl\033[0m to a' \
20+
&& echo 'directory in your search PATH.' \
21+
&& echo \
22+
&& echo 'See http://docs.deis.io/ for documentation.' \
23+
&& echo"
1724

1825
install:
1926
godep go install -v .

deisctl/backend/fleet/unit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
// path hierarchy for finding systemd service templates
1515
var templatePaths = []string{
1616
os.Getenv("DEISCTL_UNITS"),
17-
os.Getenv("HOME") + "/.deis/units",
17+
path.Join(os.Getenv("HOME"), ".deis", "units"),
1818
"/var/lib/deis/units",
1919
}
2020

deisctl/cmd/cmd.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"io/ioutil"
77
"net/http"
88
"os"
9+
"path"
910
"path/filepath"
1011
"regexp"
1112
"strconv"
@@ -283,7 +284,7 @@ Usage:
283284
deisctl refresh-units [-p <target>] [-t <tag>]
284285
285286
Options:
286-
-p --path=<target> where to save unit files [default: /var/lib/deis/units]
287+
-p --path=<target> where to save unit files [default: $HOME/.deis/units]
287288
-t --tag=<tag> git tag, branch, or SHA to use when downloading unit files
288289
[default: master]
289290
`
@@ -294,6 +295,9 @@ Options:
294295
os.Exit(2)
295296
}
296297
dir := args["--path"].(string)
298+
if dir == "$HOME/.deis/units" || dir == "~/.deis/units" {
299+
dir = path.Join(os.Getenv("HOME"), ".deis", "units")
300+
}
297301
// create the target dir if necessary
298302
if err := os.MkdirAll(dir, 0755); err != nil {
299303
return err

0 commit comments

Comments
 (0)