Skip to content

Commit 08e63d4

Browse files
authored
Adjust to newest nushell, drop support for macos (#23)
* Adjust to newest nushell, drop support for macos
1 parent 64a7c87 commit 08e63d4

File tree

20 files changed

+83
-252
lines changed

20 files changed

+83
-252
lines changed

.ansible-lint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
---
22
skip_list:
33
- risky-shell-pipe
4+
- line-length

.ansible/roles/yethal.nushell

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/home/yethal/Repos/ansible-role-nushell

.github/workflows/ci.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,24 @@ jobs:
3838
run: |
3939
pip3 install -r requirements.txt
4040
41-
- name: Run yamllint
42-
run: yamllint .
43-
4441
- name: Run ansible-lint
4542
run: ansible-lint . --exclude molecule/common/*
4643

4744
- name: Generate test list
4845
id: tests-list
49-
run: echo "tests=$(ls molecule | grep -v "common\|macos" | jq -sRc 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
46+
run: echo "tests=$(ls molecule | grep -v "common" | jq -sRc 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
5047

5148
molecule:
5249
name: Molecule
53-
runs-on: ${{ matrix.os }}
50+
runs-on: ubuntu-latest
5451
needs: lint
5552
strategy:
5653
fail-fast: false
5754
matrix:
58-
os:
59-
- ubuntu-latest
6055
distro:
6156
- ubuntu2004
6257
- ubuntu2404
6358
scenario: ${{ fromJson(needs.lint.outputs.tests) }}
64-
include:
65-
- os: macos-latest
66-
scenario: macos
6759

6860
steps:
6961
- name: Checkout code

.yamllint

Lines changed: 0 additions & 35 deletions
This file was deleted.

.yamllint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
rules:
3+
line-length: disable

defaults/main.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,3 @@ nu_plugins:
2121
- nu_plugin_query
2222
- nu_plugin_formats
2323
- nu_plugin_polars
24-
config_urls:
25-
- name: config.nu
26-
url: "https://raw.githubusercontent.com/nushell/nushell/{{ _nushell_version }}/crates/nu-utils/src/{{ 'default_files' if (_nushell_version is version('0.101.0', '>=')) else 'sample_config' }}/default_config.nu"
27-
- name: env.nu
28-
url: "https://raw.githubusercontent.com/nushell/nushell/{{ _nushell_version }}/crates/nu-utils/src/{{ 'default_files' if (_nushell_version is version('0.101.0', '>=')) else 'sample_config' }}/default_env.nu"

handlers/main.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
---
22
- name: Remove temp configs
33
ansible.builtin.file:
4-
path: "/tmp/{{ item.name }}"
4+
path: "/tmp/nushell"
55
state: absent
6-
loop: "{{ config_urls }}"
7-
loop_control:
8-
label: "{{ item.name }}"
96

107
- name: Remove download directory
118
ansible.builtin.file:

meta/main.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ galaxy_info:
2020
- name: Ubuntu
2121
versions:
2222
- all
23-
- name: macOS
24-
versions:
25-
- all
2623
galaxy_tags:
2724
- nushell
2825
- automation

molecule/banner/verify.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,16 @@
2424
ansible.builtin.lineinfile:
2525
path: "/home/{{ item }}/{{ nushell_config_path }}/config.nu"
2626
state: present
27-
backrefs: true
28-
regexp: '^(\s*)show_banner: (true|false)(.*)$'
29-
line: '\1show_banner: false\3'
27+
regexp: "^\\$env\\.config\\.show_banner = (true|false)\\s*$"
28+
line: "$env.config.show_banner = false"
3029
check_mode: true
3130
register: banner
3231
failed_when: banner is changed
3332
loop: "{{ nu_users }}"
3433

3534
- name: Assert hostname was added to prompt
3635
ansible.builtin.lineinfile:
37-
path: "/home/{{ item }}/{{ nushell_config_path }}/env.nu"
36+
path: "/home/{{ item }}/{{ nushell_config_path }}/config.nu"
3837
state: present
3938
regexp: "^.*PROMPT_INDICATOR.*$"
4039
line: "$env.PROMPT_INDICATOR = '({{ inventory_hostname }})〉'"
@@ -44,10 +43,14 @@
4443
loop: "{{ nu_users }}"
4544

4645
- name: Run nushell command to check for config errors
47-
ansible.builtin.command: "/usr/local/bin/nu -n -c 'nu-check /home/{{ item[0] }}/{{ nushell_config_path }}/{{ item[1] }}'"
46+
ansible.builtin.command:
47+
argv:
48+
- /usr/local/bin/nu
49+
- --no-config-file
50+
- --no-history
51+
- --commands
52+
- 'nu-check --debug /home/{{ item }}/{{ nushell_config_path }}/config.nu'
4853
changed_when: false
4954
register: check_output
5055
failed_when: check_output.stdout != 'true'
51-
loop: "{{ nu_users|product(['config.nu', 'env.nu']) }}"
52-
loop_control:
53-
label: "{{ item[0] }} - {{ item[1] }}"
56+
loop: "{{ nu_users }}"

molecule/common/banner.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
---
22
- name: Assert banner is not disabled
33
ansible.builtin.lineinfile:
4-
path: "/home/{{ item }}/.config/nushell/config.nu"
5-
state: present
6-
backrefs: true
7-
regexp: '^(\s*)show_banner: (true|false)(.*)$'
8-
line: '\1show_banner: true\3'
9-
check_mode: yes
4+
path: "/home/{{ item }}/{{ nushell_config_path }}/config.nu"
5+
state: absent
6+
regexp: "^\\$env\\.config\\.show_banner = (true|false)\\s*$"
7+
check_mode: true
108
register: banner
119
failed_when: banner is changed
1210
loop: "{{ nu_users }}"

0 commit comments

Comments
 (0)