1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-15 00:51:21 +01:00
Files
audacity/images/scripts/degimpify.sh
Sol Fisher Romanoff f395687c9f Change bash scripts to be POSIX-compatible
some Unix-like operating systems, namely Alpine, don't come with bash
preinstalled.
scripts in the lib-src/ directory were left untouched.

Signed-off-by: Sol Fisher Romanoff <sol@solfisher.com>
2021-12-02 10:13:12 +02:00

27 lines
776 B
Bash

#!/bin/sh
# Run this script on a directory to "degimpify" all XPM files
# within that directory (meaning any file ending with .XPM)
#
# If you run this script with no arguments, it uses the default
# directories, which are the original three directories that were
# being "degimpified" pre-fork.
shopt -s nullglob
input_dirs="$*"
if [ $# -eq 0 ]; then
input_dirs[0]="${BASH_SOURCE[0]}/../../images/EditButtons"
input_dirs[1]="${BASH_SOURCE[0]}/../../images/TranscriptionImages"
input_dirs[2]="${BASH_SOURCE[0]}/../../images/ControlButtons"
fi
for dir in "${input_dirs[@]}"
do
for xpm_file in "${dir}"/*.xpm; do
echo "Degimpify: ${xpm_file}"
sed -e 's/\_xpm\[\]/\[\]/' -e 's/^static char \*/static const char \*/' -i "$xpm_file"
done
done