Skip to content

Commit

Permalink
add script for macos installation
Browse files Browse the repository at this point in the history
  • Loading branch information
lylex committed Dec 5, 2018
1 parent ff44a2e commit 0d163b6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ drm

### MacOS ###
*.DS_Store
*.swp

### Goreleaser ###
dist/*
7 changes: 4 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ archive:
files:
- LICENSE
- README.md
- CHANGELOG*
- scripts/install_mac.sh
- scripts/drm.conf
replacements:
darwin: Darwin
linux: Linux
Expand Down Expand Up @@ -82,9 +83,9 @@ nfpm:
- gtk
conflicts:
- svn
bindir: /usr/bin
bindir: /usr/local/bin
empty_folders:
- /usr/lib/drm
- /usr/local/lib/drm
config_files:
"scripts/*.conf": "/etc/drm/*.conf"
scripts:
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const (
RootCmdName = "drm"

// DefaultConfigPath represents the default path for config.
DefaultConfigPath = "/etc/drm/drm.cfg"
DefaultConfigPath = "/etc/drm/drm.conf"

// TempFileStorePath TODO replate it
TempFileStorePath = "/Users/xuq3/workspace/drm/tem"
Expand Down
2 changes: 1 addition & 1 deletion scripts/drm.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"dataPath": "/usr/lib/drm/"
"dataPath": "/usr/local/lib/drm/"
}
18 changes: 18 additions & 0 deletions scripts/install_mac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash -ex

# Here is the workaround since we have no `deb` or `dmg` like packages for macOS

WORK_DIR="$(dirname "${BASH_SOURCE[0]}")"
CFG_DIR=/etc/drm
DATA_DIR=/usr/local/lib/drm
BIN_DIR=/usr/local/bin/

[ -d $CFG_DIR ] || mkdir $CFG_DIR

if [ ! -d $DATA_DIR ]; then
mkdir $DATA_DIR
chmod -R 777 $DATA_DIR
fi

cp $WORK_DIR/drm.conf $CFG_DIR/drm.conf
cp $WORK_DIR/../drm $BIN_DIR

0 comments on commit 0d163b6

Please sign in to comment.