Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install.sh: local extension install script #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
# Builds and installs the plugin
# into the local Inkscape extensions directory.
# NOTE Linux only! (so far)

# Exit immediately on each error and unset variable;
# see: https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
#set -Eeuo pipefail
set -Eeu

# shellcheck source=./
script_dir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
root="$script_dir"
cwd="$(pwd)"

EXT_DIR="$HOME/.config/inkscape/extensions/"

# setup
cd "${root:?}"

# build
make

# install
mkdir -p "$EXT_DIR"
cp -pr inkscape/* "$EXT_DIR/"
cp -p bitmap2component "$EXT_DIR/svg2shenzhen/bitmap2component_linux64"

# status report
cd "$EXT_DIR"
echo
echo "Installed plugin files:"
ls -lar ./*svg2shenzhen*

# cleanup
cd "$cwd"
echo
echo "done."