Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions git-bash/config/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,38 @@

{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_service_clean = tplroot ~ '.service.clean' %}
{%- from tplroot ~ "/map.jinja" import mapdata as git_bash with context %}

{%- set config = git_bash.get('config') or {} %}
{%- set install_prefix = config.get(
'install_root', 'C:\\Program Files\\Git'
) %}
{%- set gitconfig_path = [install_prefix, 'etc', 'gitconfig'] | join('\\') %}

{%- set desktop_lnk = [
'C:\\Users\\Public\\Desktop', 'Git Bash.lnk'
] | join('\\') %}
{%- set gitconfig_path = [install_prefix, 'etc', 'gitconfig'] |
join('\\') %}
{%- set profile_path = [
install_prefix, 'etc', 'profile.d', 'corporate.sh'
] | join('\\') %}
{%- set start_lnk = [
'C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs',
'Git Bash.lnk'
] | join('\\') %}

Remove Corporate Shell Profile:
file.absent:
- name: {{ profile_path | json }}

Remove Git Bash Desktop Shortcut:
file.absent:
- name: {{ desktop_lnk | json }}

Remove Git Bash Start Menu Shortcut:
file.absent:
- name: {{ start_lnk | json }}

Remove System Gitconfig File:
file.absent:
- name: {{ gitconfig_path | json }}
11 changes: 5 additions & 6 deletions git-bash/config/file.sls
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ include:
{%- set install_prefix = config.get(
'install_root', 'C:\\Program Files\\Git'
) %}
{%- set gitconfig_path = [install_prefix, 'etc', 'gitconfig'] | join('\\') %}
{%- set gitconfig_path = [install_prefix, 'etc', 'gitconfig'] |
join('\\') %}
{%- set profile_path = [
install_prefix, 'etc', 'profile.d', 'corporate.sh'
] | join('\\') %}

{%- set bash_target = [install_prefix, 'bin', 'bash.exe'] | join('\\') %}
{%- set icon_target = [
install_prefix, 'mingw64', 'share', 'git', 'git-for-windows.ico'
] | join('\\') %}
{%- set shortcut_target = [install_prefix, 'git-bash.exe'] | join('\\') %}

{%- set desktop_lnk = [
'C:\\Users\\Public\\Desktop', 'Git Bash.lnk'
Expand Down Expand Up @@ -59,22 +60,20 @@ Configure System Gitconfig File:

Create Git Bash Desktop Shortcut:
shortcut.present:
- arguments: '--login -i'
- icon_index: 0
- icon_location: {{ icon_target | json }}
- name: {{ desktop_lnk | json }}
- require:
- sls: {{ sls_package_install }}
- target: {{ bash_target | json }}
- target: {{ shortcut_target | json }}
- working_dir: {{ install_prefix | json }}

Create Git Bash Start Menu Shortcut:
shortcut.present:
- arguments: '--login -i'
- icon_index: 0
- icon_location: {{ icon_target | json }}
- name: {{ start_lnk | json }}
- require:
- sls: {{ sls_package_install }}
- target: {{ bash_target | json }}
- target: {{ shortcut_target | json }}
- working_dir: {{ install_prefix | json }}
Loading