Skip to content

Instantly share code, notes, and snippets.

@Jayman2000
Last active September 7, 2023 00:06
Show Gist options
  • Save Jayman2000/35a6db532e1fd718d2039c36bb25ed89 to your computer and use it in GitHub Desktop.
Save Jayman2000/35a6db532e1fd718d2039c36bb25ed89 to your computer and use it in GitHub Desktop.
A script used to help test a resholve PR: <https://github.com/abathur/resholve/pull/104>
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p coreutils
# 🅭🄍1.0 This file is dedicated to the public domain using the CC0 1.0 Universal
# Public Domain Dedication <https://creativecommons.org/publicdomain/zero/1.0/>.
set -e
readonly flatpak_args=(
-h --help
--version
--default-arch
--supported-arches
--gl-drivers
--installations
--print-updated-env
--print-system-only
-v -vv --verbose
--ostree-verbose
)
readonly flatpak_update_args=(
-h --help
-u --user
--system
--installation=foo
--arch=foo
--commit=foo
--force-remove
--no-pull
--no-deploy
--no-related
--no-deps
--no-static-deltas
--runtime
--app
--appstream
--subpath=foo
-y --assumeyes
--noninteractive
--sideload-repo=foo
-v --verbose
--ostree-verbose
)
function echo_command
{
local -r cmd="$1"
local arg="$2"
echo -E "$cmd $arg"
if [[ "$arg" == *=* ]]
then
arg="$(printf "%s" "$arg" | tr = " ")"
echo -E "$cmd $arg"
fi
}
{
echo '#!/usr/bin/env nix-shell'
echo '#! nix-shell -i bash -p flatpak'
echo
for arg in "${flatpak_args[@]}"
do
echo_command flatpak "$arg"
done
echo
for arg in "${flatpak_update_args[@]}"
do
echo_command "flatpak update" "$arg"
done
echo
echo "flatpak install foo bar"
} | tee flatpak-test.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment