~tardypad/dotfiles

ref: HEAD dotfiles/setup/substitute-apps -rwxr-xr-x 416 bytes
56d57f55Damien Tardy-Panis Fix aerc bindings for Backup account 2 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

SCRIPT_FILE="build/substitute-apps"

if [ -f "${SCRIPT_FILE}" ]; then
  sed -f "${SCRIPT_FILE}" -
  exit
fi

APPS_FILE="config/apps"

mkdir -p build

{
  while read -r LINE; do
    ALIAS=$( echo "${LINE}" | cut -f1 -d' ' )
    APP_COMMAND=$( echo "${LINE}" | tr -s ' ' | cut -f2- -d' ' )
    echo "s|{app/${ALIAS}}|${APP_COMMAND}|g"
  done < "${APPS_FILE}"
} > "${SCRIPT_FILE}"

sed -f "${SCRIPT_FILE}" -