Add wrapper for prusa-slicer for syncing configs

This commit is contained in:
Przemek Grondek 2022-09-12 20:51:02 +02:00
parent 5365953348
commit 8030f44df3
5 changed files with 61 additions and 9 deletions

View File

@ -0,0 +1,19 @@
#!/usr/bin/env sh
CONFIG_PATH="${HOME}/.config/PrusaSlicer"
CURRENT_DIR=$(pwd)
BIN_PATH=/usr/local/bin
cd "$CONFIG_PATH" && \
git pull
cd "${CURRENT_DIR}"
"${BIN_PATH}/prusa-slicer.real"
cd "${CONFIG_PATH}" && \
git add . && \
git commit -m "$(date +%Y.%m.%d\ %H:%M)" && \
git push
cd "${CURRENT_DIR}"

View File

@ -1,6 +0,0 @@
- name: checkout prusa profiles repo
git:
repo: "{{ prusa_slicer.repo }}"
dest: "{{ ansible_user_dir }}/.config/PrusaSlicer"
clone: yes
update: yes

View File

@ -0,0 +1,26 @@
- name: checkout prusa profiles repo
git:
repo: "{{ prusa_slicer.repo }}"
dest: "{{ ansible_user_dir }}/.config/PrusaSlicer"
clone: yes
update: yes
- name: Install wrapper
become: yes
copy:
src: usr/local/bin/prusa-slicer.wrapper
dest: /usr/local/bin/prusa-slicer.wrapper
mode: '0755'
- name: clean link
become: yes
file:
path: "/usr/local/bin/prusa-slicer"
state: absent
- name: Create symbolic link to wrapper
become: yes
file:
src: "/usr/local/bin/prusa-slicer.wrapper"
dest: "/usr/local/bin/prusa-slicer"
state: link

View File

@ -21,7 +21,7 @@
when: ansible_architecture == "x86_64" when: ansible_architecture == "x86_64"
get_url: get_url:
url: "{{ (git_info.json | json_query('assets[*].browser_download_url') | select('match', '.*x64-GTK3.*AppImage'))[0] }}" url: "{{ (git_info.json | json_query('assets[*].browser_download_url') | select('match', '.*x64-GTK3.*AppImage'))[0] }}"
dest: /usr/local/bin/prusa-slicer dest: /usr/local/bin/prusa-slicer.real
mode: 0755 mode: 0755
- name: "Download URL" - name: "Download URL"
@ -34,5 +34,18 @@
become: yes become: yes
get_url: get_url:
url: "{{ (git_info.json | json_query('assets[*].browser_download_url') | select('match', '.*armv7l-GTK2.*AppImage'))[0] }}" url: "{{ (git_info.json | json_query('assets[*].browser_download_url') | select('match', '.*armv7l-GTK2.*AppImage'))[0] }}"
dest: /usr/local/bin/prusa-slicer dest: /usr/local/bin/prusa-slicer.real
mode: 0755 mode: 0755
- name: Clean symbolic link
become: yes
file:
path: "/usr/local/bin/prusa-slicer"
state: absent
- name: Create symbolic link to real app
become: yes
file:
src: "/usr/local/bin/prusa-slicer.real"
dest: "/usr/local/bin/prusa-slicer"
state: link

View File

@ -1,3 +1,3 @@
- include: install-program.yml - include: install-program.yml
- include: checkout-git.yml - include: config-repository.yml