Skip to content

Commit

Permalink
Merge pull request #44 from noelmcloughlin/space
Browse files Browse the repository at this point in the history
fix(symlink): remove space & duplicate symlink code
  • Loading branch information
noelmcloughlin authored Jun 17, 2020
2 parents bf44069 + c0e4a55 commit e5cc14a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 22 deletions.
1 change: 1 addition & 0 deletions docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ golang-formula
Deploy and manage golang using Salt.

.. contents:: **Table of Contents**
:depth: 1

General notes
-------------
Expand Down
2 changes: 2 additions & 0 deletions golang/archive/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ golang-cli-package-archive-clean-file-absent:
- names:
- {{ golang.pkg.archive.name }}
- /usr/local/go
- /usr/local/bin/go
- /usr/local/bin/gofmt
{%- if golang.kernel == 'linux' %}
- {{ golang.path }}
{%- endif %}
13 changes: 8 additions & 5 deletions golang/archive/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ golang-package-archive-install-archive-extracted:
- user: {{ golang.rootuser }}
- group: {{ golang.rootgroup }}
{%- if golang.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS',) %}
{%- if golang.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'FreeBSD', 'MacOS') %}
{% for i in ('go', 'gofmt') %}
golang-archive-install-file-symlink-golang:
golang-package-archive-install-symlink-{{ i }}:
file.symlink:
- name: /usr/local/bin/go
- target: {{ golang.path }}/{{ golang.command }}
- name: /usr/local/bin/{{ i }}
- target: {{ golang.path }}/go/bin/{{ i }}
- mode: '0755'
- force: True
- onlyif: test -f {{ golang.path }}/{{ golang.command }}
- onlyif: test -x {{ golang.path }}/go/bin/{{ i }}
{%- endfor %}
{%- endif %}
17 changes: 0 additions & 17 deletions golang/config/environ.sls
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,3 @@ golang-config-file-managed-environ_file:
golang: {{ golang|json }}
- require:
- sls: {{ sls_archive_install if golang.pkg.use_upstream_archive else sls_package_install }}
{% for i in ('go', 'gofmt') %}
# create symlink under certain conditions
# archlinux, freebsd, macos for now
golang-config-file-symlink-{{ i }}-golang-binary:
file.symlink:
- name: /usr/local/bin/{{ i }}
- target: {{ golang.path }}/ {{ i }}
- mode: '0755'
- force: True
- onlyif:
- {{ grains.os_family in ('Arch', 'FreeBSD', 'MacOS') }}
- test -x {{ golang.path }}/ {{ i }}
{%- endfor %}

0 comments on commit e5cc14a

Please sign in to comment.