Make better use of autotools (#149)
* Check for inkscape, optipng, and sass in the PATH with configure * Define themedirs once in configure instead of each Makefile * Set GTK3_VERSION to compatible version instead of actual version autotools doesn't like symlinks much, especially when building outside of the source tree. This also adds better version detection errors. * Don't distribute gulpfile.js as it has been removed * Don't need $(srcdir) when defining EXTRA_DIST Distributions are always prepared from the sources. * Install theme index files using automake * Generate and install XFWM4 files properly with autotools This handles parallelism better and allows out-of-source builds. * Generate and install GTK+2 files properly with autotools This handles parallelism better and allows out-of-source builds. * Generate and install GTK+3 files properly with autotools This handles parallelism better and allows out-of-source builds.master
@ -0,0 +1,78 @@ |
||||
VPATH =
|
||||
|
||||
targets := $(shell cat $(srcdir)/assets.txt)
|
||||
light := $(patsubst %,light/assets/%.png,$(targets))
|
||||
dark := $(patsubst %,dark/assets/%.png,$(targets))
|
||||
|
||||
mbt_entry := $(filter entry-%toolbar,$(targets))
|
||||
mbt_menubar := $(filter menubar%,$(targets))
|
||||
mbt_button := $(filter button%,$(targets))
|
||||
|
||||
mbt_light := \
|
||||
$(srcdir)/menubar-toolbar/menubar-toolbar.rc \
|
||||
$(patsubst %,menubar-toolbar/%.png,$(mbt_entry) $(mbt_menubar))
|
||||
|
||||
mbt_dark := \
|
||||
$(srcdir)/menubar-toolbar/menubar-toolbar-dark.rc \
|
||||
$(patsubst %,menubar-toolbar/%-dark.png,$(mbt_entry) $(mbt_menubar)) \
|
||||
$(patsubst %,menubar-toolbar/%.png,$(mbt_button))
|
||||
|
||||
rc := apps main panel xfce-notify
|
||||
srcrc := $(patsubst %,$(srcdir)/%.rc,$(rc))
|
||||
|
||||
light: $(light) |
||||
dark: $(dark) |
||||
mbt_light: $(mbt_light) |
||||
mbt_dark: $(mbt_dark) |
||||
|
||||
light/assets dark/assets menubar-toolbar: |
||||
$(MKDIR_P) "$@"/
|
||||
|
||||
clean: |
||||
rm -rf light/assets/ dark/assets/ menubar-toolbar/*.png
|
||||
|
||||
$(light): $(srcdir)/light/assets.svg | light/assets |
||||
$(dark): $(srcdir)/dark/assets.svg | dark/assets |
||||
|
||||
$(light) $(dark): |
||||
$(INKSCAPE) --export-id-only --export-png="$@" --export-id="$(basename $(notdir $@))" --export-dpi=$(if $(filter $(OPTION_GTK2_HIDPI),true),192,96) "$<" >/dev/null
|
||||
$(OPTIPNG) -o7 --quiet "$@"
|
||||
|
||||
menubar-toolbar/%-dark.png: dark/assets/%.png | menubar-toolbar |
||||
cp "$<" "$@"
|
||||
|
||||
menubar-toolbar/%.png: light/assets/%.png | menubar-toolbar |
||||
cp "$<" "$@"
|
||||
|
||||
.PHONY: light dark mbt_light mbt_dark clean |
||||
|
||||
if ENABLE_LIGHT |
||||
gtk2themedir = $(themedir)/gtk-2.0
|
||||
gtk2themeassetsdir = $(gtk2themedir)/assets
|
||||
gtk2theme_DATA = $(srcrc) $(srcdir)/light/gtkrc
|
||||
gtk2themeassets_DATA = $(light)
|
||||
nobase_gtk2theme_DATA = $(mbt_light)
|
||||
endif |
||||
|
||||
if ENABLE_DARKER |
||||
gtk2themedarkerdir = $(themedarkerdir)/gtk-2.0
|
||||
gtk2themedarkerassetsdir = $(gtk2themedarkerdir)/assets
|
||||
gtk2themedarker_DATA = $(srcrc) $(srcdir)/darker/gtkrc
|
||||
gtk2themedarkerassets_DATA = $(light)
|
||||
nobase_gtk2themedarker_DATA = $(mbt_dark)
|
||||
endif |
||||
|
||||
if ENABLE_DARK |
||||
gtk2themedarkdir = $(themedarkdir)/gtk-2.0
|
||||
gtk2themedarkassetsdir = $(gtk2themedarkdir)/assets
|
||||
gtk2themedark_DATA = $(srcrc) $(srcdir)/dark/gtkrc
|
||||
gtk2themedarkassets_DATA = $(dark)
|
||||
nobase_gtk2themedark_DATA = $(mbt_dark)
|
||||
endif |
||||
|
||||
EXTRA_DIST = \
|
||||
assets.txt \
|
||||
$(srcrc) \
|
||||
$(patsubst %,%/assets.svg,light dark) \
|
||||
$(patsubst %,%/gtkrc,light darker dark) \
|
||||
$(patsubst %,menubar-toolbar/menubar-toolbar%,.rc -dark.rc)
|
Before Width: | Height: | Size: 250 KiB After Width: | Height: | Size: 250 KiB |
Before Width: | Height: | Size: 257 KiB After Width: | Height: | Size: 257 KiB |
@ -1,29 +0,0 @@ |
||||
#!/bin/bash |
||||
set -ueo pipefail |
||||
|
||||
INKSCAPE="$(which inkscape)" |
||||
OPTIPNG="$(which optipng)" |
||||
|
||||
ASSETS_DIR="$1" |
||||
SRC_FILE="${ASSETS_DIR}".svg |
||||
|
||||
i="$2" |
||||
|
||||
|
||||
result_file="$ASSETS_DIR/$i.png" |
||||
if [[ -f "${result_file}" ]] ; then |
||||
echo "${result_file} already exists." |
||||
else |
||||
echo "Rendering '${result_file}'" |
||||
if [[ "${OPTION_GTK2_HIDPI:-false}" != "true" ]]; then |
||||
"$INKSCAPE" --export-id="$i" \ |
||||
--export-id-only \ |
||||
--export-png="${result_file}" "$SRC_FILE" >/dev/null |
||||
else |
||||
"$INKSCAPE" --export-id="$i" \ |
||||
--export-id-only \ |
||||
--export-dpi=192 \ |
||||
--export-png="${result_file}" "$SRC_FILE" >/dev/null |
||||
fi |
||||
"$OPTIPNG" -o7 --quiet "${result_file}" |
||||
fi |
@ -1,41 +0,0 @@ |
||||
#!/bin/bash |
||||
set -ueo pipefail |
||||
|
||||
# Make sure that parallel is GNU parallel and not moreutils. |
||||
# Otherwise, it fails silently. There's no smooth way to detect this. |
||||
if [[ "$(which parallel 2> /dev/null)" ]]; then |
||||
cmd=(parallel) |
||||
else |
||||
cmd=(xargs -n1) |
||||
fi |
||||
|
||||
|
||||
ASSETS_DIR="assets" |
||||
DARK_ASSETS_DIR="assets-dark" |
||||
|
||||
|
||||
"${cmd[@]}" ./render-asset.sh ${ASSETS_DIR} < assets.txt |
||||
"${cmd[@]}" ./render-asset.sh ${DARK_ASSETS_DIR} < assets.txt |
||||
|
||||
|
||||
cp $ASSETS_DIR/entry-toolbar.png menubar-toolbar/entry-toolbar.png |
||||
cp $ASSETS_DIR/entry-active-toolbar.png menubar-toolbar/entry-active-toolbar.png |
||||
cp $ASSETS_DIR/entry-disabled-toolbar.png menubar-toolbar/entry-disabled-toolbar.png |
||||
|
||||
cp $ASSETS_DIR/menubar.png menubar-toolbar/menubar.png |
||||
cp $ASSETS_DIR/menubar_button.png menubar-toolbar/menubar_button.png |
||||
|
||||
|
||||
cp $DARK_ASSETS_DIR/button.png menubar-toolbar/button.png |
||||
cp $DARK_ASSETS_DIR/button-hover.png menubar-toolbar/button-hover.png |
||||
cp $DARK_ASSETS_DIR/button-active.png menubar-toolbar/button-active.png |
||||
cp $DARK_ASSETS_DIR/button-insensitive.png menubar-toolbar/button-insensitive.png |
||||
|
||||
cp $DARK_ASSETS_DIR/entry-toolbar.png menubar-toolbar/entry-toolbar-dark.png |
||||
cp $DARK_ASSETS_DIR/entry-active-toolbar.png menubar-toolbar/entry-active-toolbar-dark.png |
||||
cp $DARK_ASSETS_DIR/entry-disabled-toolbar.png menubar-toolbar/entry-disabled-toolbar-dark.png |
||||
|
||||
cp $DARK_ASSETS_DIR/menubar.png menubar-toolbar/menubar-dark.png |
||||
cp $DARK_ASSETS_DIR/menubar_button.png menubar-toolbar/menubar_button-dark.png |
||||
|
||||
exit 0 |
@ -0,0 +1,31 @@ |
||||
include ../common.am |
||||
|
||||
light/gtk.css: gtk.css | light |
||||
cp "$<" "$@"
|
||||
light/gtk-dark.css: gtk-dark.css | light |
||||
cp "$<" "$@"
|
||||
darker/gtk.css: gtk-darker.css | darker |
||||
cp "$<" "$@"
|
||||
darker/gtk-dark.css: gtk-dark.css | darker |
||||
cp "$<" "$@"
|
||||
dark/gtk.css: gtk-dark.css | dark |
||||
cp "$<" "$@"
|
||||
|
||||
gtk3themeassetsdir = $(gtk3themedir)/assets
|
||||
gtk3themedarkerassetsdir = $(gtk3themedarkerdir)/assets
|
||||
gtk3themedarkassetsdir = $(gtk3themedarkdir)/assets
|
||||
|
||||
if ENABLE_LIGHT |
||||
gtk3theme_DATA = light/gtk.css light/gtk-dark.css
|
||||
gtk3themeassets_DATA = $(normal) $(hidpi)
|
||||
endif |
||||
|
||||
if ENABLE_DARKER |
||||
gtk3themedarker_DATA = darker/gtk.css darker/gtk-dark.css
|
||||
gtk3themedarkerassets_DATA = $(normal) $(hidpi)
|
||||
endif |
||||
|
||||
if ENABLE_DARK |
||||
gtk3themedark_DATA = dark/gtk.css
|
||||
gtk3themedarkassets_DATA = $(normal) $(hidpi)
|
||||
endif |
@ -1,23 +0,0 @@ |
||||
#!/bin/bash |
||||
set -ueo pipefail |
||||
|
||||
INKSCAPE="$(which inkscape)" |
||||
OPTIPNG="$(which optipng)" |
||||
|
||||
SRC_FILE="assets.svg" |
||||
ASSETS_DIR="assets" |
||||
|
||||
i="$1" |
||||
|
||||
echo "Rendering '$ASSETS_DIR/$i.png'" |
||||
"$INKSCAPE" --export-id="$i" \ |
||||
--export-id-only \ |
||||
--export-png="$ASSETS_DIR/$i.png" "$SRC_FILE" >/dev/null \ |
||||
&& "$OPTIPNG" -o7 --quiet "$ASSETS_DIR/$i.png" |
||||
|
||||
echo "Rendering '$ASSETS_DIR/$i@2.png'" |
||||
"$INKSCAPE" --export-id="$i" \ |
||||
--export-id-only \ |
||||
--export-dpi=192 \ |
||||
--export-png="$ASSETS_DIR/$i@2.png" "$SRC_FILE" >/dev/null \ |
||||
&& "$OPTIPNG" -o7 --quiet "$ASSETS_DIR/$i@2.png" |
@ -1,12 +0,0 @@ |
||||
#!/bin/bash |
||||
set -ueo pipefail |
||||
|
||||
# Make sure that parallel is GNU parallel and not moreutils. |
||||
# Otherwise, it fails silently. There's no smooth way to detect this. |
||||
if [[ "$(which parallel 2> /dev/null)" ]]; then |
||||
cmd=(parallel) |
||||
else |
||||
cmd=(xargs -n1) |
||||
fi |
||||
|
||||
"${cmd[@]}" ./render-asset.sh < assets.txt |
@ -0,0 +1,35 @@ |
||||
include ../common.am |
||||
|
||||
light/gtk-main.css: gtk.css | light |
||||
cp "$<" "$@"
|
||||
light/gtk-main-dark.css: gtk-dark.css | light |
||||
cp "$<" "$@"
|
||||
darker/gtk-main.css: gtk-darker.css | darker |
||||
cp "$<" "$@"
|
||||
darker/gtk-main-dark.css: gtk-dark.css | darker |
||||
cp "$<" "$@"
|
||||
dark/gtk-main.css: gtk-dark.css | dark |
||||
cp "$<" "$@"
|
||||
dark/gtk-main-dark.css: | dark |
||||
touch "$@"
|
||||
|
||||
%/gtk.css %/gtk-dark.css: | % |
||||
echo '@import url("resource:///org/gnome/arc-theme/$(subst gtk,gtk-main,$(notdir $@))");' > "$@"
|
||||
|
||||
%/gtk.gresource.xml: | % |
||||
echo "<?xml version='1.0' encoding='UTF-8'?><gresources><gresource prefix='/org/gnome/arc-theme'>$(patsubst %,<file preprocess='to-pixdata'>../%</file>,$(normal) $(hidpi))<file>gtk-main.css</file>$(if $(filter $(dir $@),dark/),,<file>gtk-main-dark.css</file>)</gresource></gresources>" > "$@"
|
||||
|
||||
%/gtk.gresource: %/gtk.gresource.xml %/gtk-main.css %/gtk-main-dark.css $(normal) $(hidpi) |
||||
glib-compile-resources --sourcedir="$(dir $<)" --target="$@" "$<"
|
||||
|
||||
if ENABLE_LIGHT |
||||
gtk3theme_DATA = light/gtk.css light/gtk-dark.css light/gtk.gresource
|
||||
endif |
||||
|
||||
if ENABLE_DARKER |
||||
gtk3themedarker_DATA = darker/gtk.css darker/gtk-dark.css darker/gtk.gresource
|
||||
endif |
||||
|
||||
if ENABLE_DARK |
||||
gtk3themedark_DATA = dark/gtk.css dark/gtk.gresource
|
||||
endif |
@ -1,56 +0,0 @@ |
||||
#!/bin/bash |
||||
|
||||
# Setup |
||||
mv gtk.css gtk-main.css |
||||
if [ "$1" != "DARK" ]; then |
||||
mv gtk-dark.css gtk-main-dark.css |
||||
fi |
||||
|
||||
# Get processed assets lists |
||||
ls ./assets | sort > temp_asset_list.txt |
||||
|
||||
|
||||
# Build dynamic gresouce xml spec from css and assets |
||||
read -d '' RES_PART1 <<"EOF" |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<gresources> |
||||
<gresource prefix="/org/gnome/arc-theme"> |
||||
EOF |
||||
echo $RES_PART1 > gtk.gresource.xml |
||||
|
||||
|
||||
# Import as nodes the file assets |
||||
xargs -i echo '<file preprocess="to-pixdata">assets/{}</file>' >> gtk.gresource.xml < temp_asset_list.txt |
||||
rm -f temp_asset_list.txt |
||||
|
||||
|
||||
# Write the css file information to the template |
||||
if [ "$1" != "DARK" ]; then |
||||
read -d '' RES_PART2 <<"EOF" |
||||
<file>gtk-main.css</file> |
||||
<file>gtk-main-dark.css</file> |
||||
</gresource> |
||||
</gresources> |
||||
EOF |
||||
else |
||||
read -d '' RES_PART2 <<"EOFDARK" |
||||
<file>gtk-main.css</file> |
||||
</gresource> |
||||
</gresources> |
||||
EOFDARK |
||||
fi |
||||
echo $RES_PART2 >> gtk.gresource.xml |
||||
|
||||
# Compile the gresource file |
||||
glib-compile-resources gtk.gresource.xml |
||||
echo '@import url("resource:///org/gnome/arc-theme/gtk-main.css");' > gtk.css |
||||
if [ "$1" != "DARK" ]; then |
||||
echo '@import url("resource:///org/gnome/arc-theme/gtk-main-dark.css");' > gtk-dark.css |
||||
fi |
||||
|
||||
# Cleanup |
||||
rm -rf assets |
||||
rm -f gtk.gresource.xml |
||||
rm -f gtk-main.css |
||||
rm -f gtk-main-dark.css |
||||
rm -f compile-gresources.sh |
@ -1,28 +0,0 @@ |
||||
#!/bin/bash |
||||
set -ueo pipefail |
||||
|
||||
INKSCAPE="$(which inkscape)" |
||||
OPTIPNG="$(which optipng)" |
||||
|
||||
SRC_FILE="assets.svg" |
||||
ASSETS_DIR="assets" |
||||
|
||||
i="$1" |
||||
|
||||
result_file="$ASSETS_DIR/$i.png" |
||||
if [[ -f "${result_file}" ]] ; then |
||||
echo "${result_file} already exists." |
||||
else |
||||
echo "Rendering '$ASSETS_DIR/$i.png'" |
||||
"$INKSCAPE" --export-id="$i" \ |
||||
--export-id-only \ |
||||
--export-png="$ASSETS_DIR/$i.png" "$SRC_FILE" >/dev/null \ |
||||
&& "$OPTIPNG" -o7 --quiet "$ASSETS_DIR/$i.png" |
||||
|
||||
echo "Rendering '$ASSETS_DIR/$i@2.png'" |
||||
"$INKSCAPE" --export-id="$i" \ |
||||
--export-id-only \ |
||||
--export-dpi=192 \ |
||||
--export-png="$ASSETS_DIR/$i@2.png" "$SRC_FILE" >/dev/null \ |
||||
&& "$OPTIPNG" -o7 --quiet "$ASSETS_DIR/$i@2.png" |
||||
fi |
@ -1,12 +0,0 @@ |
||||
#!/bin/bash |
||||
set -ueo pipefail |
||||
|
||||
# Make sure that parallel is GNU parallel and not moreutils. |
||||
# Otherwise, it fails silently. There's no smooth way to detect this. |
||||
if [[ "$(which parallel 2> /dev/null)" ]]; then |
||||
cmd=(parallel) |
||||
else |
||||
cmd=(xargs -n1) |
||||
fi |
||||
|
||||
"${cmd[@]}" ./render-asset.sh < assets.txt |
@ -1 +0,0 @@ |
||||
3.20 |
@ -1 +0,0 @@ |
||||
3.20 |
@ -0,0 +1,19 @@ |
||||
if ENABLE_LIGHT |
||||
gtk3theme_DATA = light/thumbnail.png
|
||||
endif |
||||
|
||||
if ENABLE_DARKER |
||||
gtk3themedarker_DATA = light/thumbnail.png
|
||||
endif |
||||
|
||||
if ENABLE_DARK |
||||
gtk3themedark_DATA = dark/thumbnail.png
|
||||
endif |
||||
|
||||
EXTRA_DIST = \
|
||||
light \
|
||||
dark \
|
||||
_colors.scss.thpl
|
||||
|
||||
SUBDIRS = $(GTK3_VERSION)
|
||||
DIST_SUBDIRS = 3.18 3.20
|
@ -0,0 +1,39 @@ |
||||
VPATH = |
||||
|
||||
targets := $(shell cat $(srcdir)/assets.txt) |
||||
normal := $(patsubst %,assets/%.png,$(targets)) |
||||
hidpi := $(patsubst %,assets/%@2.png,$(targets)) |
||||
|
||||
normal: $(normal) |
||||
hidpi: $(hidpi) |
||||
|
||||
assets light dark darker: |
||||
$(MKDIR_P) "$@"/ |
||||
|
||||
clean: |
||||
rm -rf assets/ light/ dark/ darker/ |
||||
|
||||
$(normal): $(srcdir)/assets.svg | assets |
||||
$(INKSCAPE) --export-id-only --export-png="$@" --export-id="$(basename $(notdir $@))" --export-dpi=96 "$<" >/dev/null |
||||
$(OPTIPNG) -o7 --quiet "$@" |
||||
|
||||
$(hidpi): $(srcdir)/assets.svg | assets |
||||
$(INKSCAPE) --export-id-only --export-png="$@" --export-id="$(patsubst %@2,%,$(basename $(notdir $@)))" --export-dpi=192 "$<" >/dev/null |
||||
$(OPTIPNG) -o7 --quiet "$@" |
||||
|
||||
.PHONY: normal hidpi clean |
||||
|
||||
if ENABLE_TRANSPARENCY |
||||
%.css: $(srcdir)/sass/%.scss |
||||
$(SASSC) "$<" "$@" |
||||
else |
||||
gtk.css: $(srcdir)/sass/gtk-solid.scss |
||||
$(SASSC) "$<" "$@" |
||||
gtk-%.css: $(srcdir)/sass/gtk-solid-%.scss |
||||
$(SASSC) "$<" "$@" |
||||
endif |
||||
|
||||
EXTRA_DIST = \ |
||||
assets.txt \ |
||||
assets.svg \ |
||||
sass |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,43 @@ |
||||
VPATH =
|
||||
|
||||
targets := $(shell cat $(srcdir)/assets.txt)
|
||||
light := $(patsubst %,light/assets/%.png,$(targets))
|
||||
dark := $(patsubst %,dark/assets/%.png,$(targets))
|
||||
|
||||
light: $(light) |
||||
dark: $(dark) |
||||
|
||||
light/assets dark/assets: |
||||
$(MKDIR_P) "$@"/
|
||||
|
||||
clean: |
||||
rm -rf light/assets/ dark/assets/
|
||||
|
||||
$(light): $(srcdir)/light/assets.svg | light/assets |
||||
$(dark): $(srcdir)/dark/assets.svg | dark/assets |
||||
|
||||
$(light) $(dark): |
||||
$(INKSCAPE) --export-id-only --export-png="$@" --export-id="$(basename $(notdir $@))" --export-dpi=$(if $(filter $(OPTION_GTK2_HIDPI),true),192,96) "$<" >/dev/null
|
||||
$(OPTIPNG) -o7 --quiet "$@"
|
||||
|
||||
.PHONY: light dark clean |
||||
|
||||
if ENABLE_LIGHT |
||||
xfwm4themedir = $(themedir)/xfwm4
|
||||
xfwm4theme_DATA = $(srcdir)/light/themerc $(light)
|
||||
endif |
||||
|
||||
if ENABLE_DARKER |
||||
xfwm4themedarkerdir = $(themedarkerdir)/xfwm4
|
||||
xfwm4themedarker_DATA = $(srcdir)/dark/themerc $(dark)
|
||||
endif |
||||
|
||||
if ENABLE_DARK |
||||
xfwm4themedarkdir = $(themedarkdir)/xfwm4
|
||||
xfwm4themedark_DATA = $(srcdir)/dark/themerc $(dark)
|
||||
endif |
||||
|
||||
EXTRA_DIST = \
|
||||
assets.txt \
|
||||
$(patsubst %,%/assets.svg,light dark) \
|
||||
$(patsubst %,%/themerc,light dark)
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
@ -1,29 +0,0 @@ |
||||
#!/bin/bash |
||||
set -ueo pipefail |
||||
|
||||
INKSCAPE="$(which inkscape)" |
||||
OPTIPNG="$(which optipng)" |
||||
|
||||
ASSETS_DIR="$1" |
||||
SRC_FILE="${ASSETS_DIR}".svg |
||||
|
||||
i="$2" |
||||
|
||||
|
||||
result_file="$ASSETS_DIR/$i.png" |
||||
if [[ -f "${result_file}" ]] ; then |
||||
echo "${result_file} already exists." |
||||
else |
||||
echo "Rendering '${result_file}'" |
||||
if [[ "${OPTION_GTK2_HIDPI:-false}" != "true" ]]; then |
||||
"$INKSCAPE" --export-id="$i" \ |
||||
--export-id-only \ |
||||
--export-png="${result_file}" "$SRC_FILE" >/dev/null |
||||
else |
||||
"$INKSCAPE" --export-id="$i" \ |
||||
--export-id-only \ |
||||
--export-dpi=192 \ |
||||
--export-png="${result_file}" "$SRC_FILE" >/dev/null |
||||
fi |
||||
"$OPTIPNG" -o7 --quiet "${result_file}" |
||||
fi |
@ -1,13 +0,0 @@ |
||||
#!/bin/bash |
||||
set -ueo pipefail |
||||
|
||||
# Make sure that parallel is GNU parallel and not moreutils. |
||||
# Otherwise, it fails silently. There's no smooth way to detect this. |
||||
if [[ "$(which parallel 2> /dev/null)" ]]; then |
||||
cmd=(parallel) |
||||
else |
||||
cmd=(xargs -n1) |
||||
fi |
||||
|
||||
"${cmd[@]}" ./render-asset.sh assets < assets.txt |
||||
"${cmd[@]}" ./render-asset.sh assets-dark < assets.txt |