Ignore exit code of string-split0

This commit is contained in:
Manuel Thalmann 2024-12-05 16:34:24 +01:00
parent 6f5d13f07f
commit 1051fe01c1
11 changed files with 15 additions and 15 deletions

View file

@ -31,7 +31,7 @@ function deploySoftware -d "Deploys a the specified software action" -a action
source "$dir/../Software/xone/main.fish" $argv
end
and for component in (getOSConfig hardware.components --json | jq '.[]' --raw-output0 | string split0)
and for component in (getOSConfig hardware.components --json | jq '.[]' --raw-output0 | string split0 || true)
switch "$component"
case "Logitech G903"
source "$dir/../../Common/Drivers/Logitech G903/main.fish" $argv

View file

@ -26,7 +26,7 @@ function backupAction -V dir
runHook backupUsers || begin
if [ -n "$deployScript" ]
for name in (getUsers | jq '.[]' --raw-output0 | string split0)
for name in (getUsers | jq '.[]' --raw-output0 | string split0 || true)
echo "Backing up user `$name`..."
and source $deployScript userBackup --user $name
end

View file

@ -34,7 +34,7 @@ function installAction -V dir
if [ -n "$deployScript" ]
source "$dir/../../lib/settings.fish"
for name in (getUsers | jq '.[]' --raw-output0 | string split0)
for name in (getUsers | jq '.[]' --raw-output0 | string split0 || true)
echo "Configuring user `$name`..."
and source $deployScript userConfig --user $name
end

View file

@ -5,7 +5,7 @@ set -l users (getUsers)
echo "Creating users..."
for name in (echo "$users" | jq '.[]' --raw-output0 | string split0)
for name in (echo "$users" | jq '.[]' --raw-output0 | string split0 || true)
echo "Creating user `$name`..."
function getUserInfo -V name -a config

View file

@ -33,7 +33,7 @@ function installExtension -d "Installs a Chromium extension for the browser with
sudo chmod -R u+w "$extensionDir"
sudo mkdir -p "$policyDir"
for manifest in (find "$policyDir" -name "*.json" -print0 | string split0)
for manifest in (find "$policyDir" -name "*.json" -print0 | string split0 || true)
if [ (cat "$manifest" | jq -r ".$property") = "$destination" ]
sudo rm "$manifest"
end

View file

@ -18,7 +18,7 @@ begin
argparse -i "name=" "user=" -- $argv
set -l services (getProgramConfig --name "$_flag_name" --json | jq '.services')
for service in (echo "$services" | jq '. // {} | keys[]' --raw-output0 | string split0)
for service in (echo "$services" | jq '. // {} | keys[]' --raw-output0 | string split0 || true)
if echo "$services" | SERVICE=$service jq --exit-status ".[env.SERVICE].enable" >/dev/null
fish "$dir/services/$service/main.fish" $argv

View file

@ -30,7 +30,7 @@ begin
set uid (id -u $user)
set gid (id -g $user)
for service in (yq -0 ".services | keys[]" "$config" | string split0)
for service in (yq -0 ".services | keys[]" "$config" | string split0 || true)
set -l envKey "$(getServiceKey "$service").environment"
cp "$config" "$file"

View file

@ -129,10 +129,10 @@ begin
function installDockerService -V dir -V nginxRoot
set -l config (getServiceOverrides $argv)
set -l servers (getServiceServers $argv | string split0)
set -l servers (getServiceServers $argv | string split0 || true)
for i in (seq 1 2 (count $servers))
set -l locations (getServiceLocations $i $argv | string split0)
set -l locations (getServiceLocations $i $argv | string split0 || true)
for j in (seq 1 3 (count $locations))
set -l file (mktemp)
@ -151,13 +151,13 @@ begin
end
function configureDockerService
set -l servers (getServiceServers $argv | string split0)
set -l servers (getServiceServers $argv | string split0 || true)
set -l nginxConfig (__getServiceNginxConfig $argv)
for i in (seq 1 2 (count $servers))
set -l domain $servers[(math $i + 1)]
set -l subdomain $servers[(math $i)]
set -l locations (getServiceLocations $i $argv | string split0)
set -l locations (getServiceLocations $i $argv | string split0 || true)
set domain (getServiceDomain "$subdomain" "$domain")
begin

View file

@ -73,7 +73,7 @@ begin
set sessionPid (sudo pgrep -t $freeTty -u "$name")
end
sudo openvt -sw -- sudo -u "$name" env (sudo cat /proc/$sessionPid/environ | string split0) /usr/lib/plasma-dbus-run-session-if-needed startplasma-wayland
sudo openvt -sw -- sudo -u "$name" env (sudo cat /proc/$sessionPid/environ | string split0 || true) /usr/lib/plasma-dbus-run-session-if-needed startplasma-wayland
sudo rm "$entryPoint"
sudo rm "$welcomeConfig"
sudo rm "$sessionConfig"
@ -87,7 +87,7 @@ begin
mkdir -p ~/.mnt
touch ~/.mnt/.trackerignore
for config in (echo "$configs" | jq '.[]' --raw-output0 | string split0)
for config in (echo "$configs" | jq '.[]' --raw-output0 | string split0 || true)
set -l configKey "$key.$config"
set -l duration "$configKey.cacheDuration"

View file

@ -44,7 +44,7 @@ function runSetupUserAction -V dir
set -l name (getOSConfig setupUser.name)
if [ "$USER" != "$name" ]
set -l cmdline (cat /proc/$fish_pid/cmdline | string split0)
set -l cmdline (cat /proc/$fish_pid/cmdline | string split0 || true)
if [ (id -u) -ne 0 ]
sudo --set-home --preserve-env env "PATH=$PATH" $cmdline

View file

@ -215,7 +215,7 @@ begin
and begin
source "$dir/../scripts/lib/settings.fish"
and for name in (getProfiles | jq '.[]' --raw-output0 | string split0)
and for name in (getProfiles | jq '.[]' --raw-output0 | string split0 || true)
set -l CONFIG_NAME "$name"
set -l file "$projectPath/.config/$name.json"
and mkdir -p (dirname $file)