mirror of
https://github.com/notwa/rc
synced 2025-02-05 07:43:22 -08:00
treat mingw.sh as actual script, bash syntax fix
This commit is contained in:
parent
2c2ec2cf3c
commit
2769fb38fc
3 changed files with 11 additions and 9 deletions
|
@ -66,6 +66,6 @@ alias unwrap='awk '\''BEGIN{RS="\n\n";FS="\n"}{for(i=1;i<=NF;i++)printf "%s ",$i
|
|||
alias picky='{ pacman -Qgq base base-devel | tee -; pacman -Qtnq; } | sort | uniq -u'
|
||||
alias unused='{ pacman -Qt; pacman -Qe | tee -; } | sort | uniq -u'
|
||||
|
||||
. ~/mingw.sh
|
||||
#. ~/mingw.sh
|
||||
. ~/sh/lsf.sh/lsf.sh
|
||||
. ~/sh/z/z.sh
|
||||
|
|
|
@ -40,7 +40,7 @@ PATH="${PATH:?No existing PATH}:$rc/sh"
|
|||
|
||||
umask 027
|
||||
|
||||
for f in .bashrc .zshrc shrc.zsh mingw.sh .vimrc .conkyrc .inputrc .screenrc .xinitrc; do
|
||||
for f in .bashrc .zshrc shrc.zsh .vimrc .conkyrc .inputrc .screenrc .xinitrc; do
|
||||
dotless "$f"
|
||||
r="$rc/home/$REPLY"
|
||||
hardlink "$f" "$r"
|
||||
|
|
16
home/mingw.sh → sh/mw
Normal file → Executable file
16
home/mingw.sh → sh/mw
Normal file → Executable file
|
@ -1,3 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
mkdir -p ~/opt/mingw
|
||||
|
||||
_mw_enabled=0
|
||||
|
@ -6,11 +7,11 @@ _mw_bin=~/src/mxe/usr/bin
|
|||
_mw_misc=~/src/mxe/usr/$_mw_host
|
||||
_mw_prefix=~/opt/mingw
|
||||
|
||||
declare -A _mw_
|
||||
typeset -Ag _mw_ # cryptic math expression errors if not global!
|
||||
|
||||
_mw_export() {
|
||||
[ -z "$1" ] && return 1
|
||||
[ -n "${ZSH_VERSION:-}" ] && _mw_[$1]=${(P)1} || _mw_[$1]="${!1}"
|
||||
[ -n "${ZSH_VERSION:-}" ] && _mw_[$1]="${(P)1}" || _mw_[$1]="${!1}"
|
||||
export "$1=$2"
|
||||
}
|
||||
|
||||
|
@ -19,8 +20,7 @@ mingw-disable() {
|
|||
_mw_enabled=0
|
||||
|
||||
local e=
|
||||
for e in PATH PREFIX CC CPP CXX CFLAGS CPPFLAGS CXXFLAGS LDFLAGS \
|
||||
AR RANLIB RC WINDRES SDL_CFLAGS SDL_LDLIBS; do
|
||||
for e in PATH PREFIX CC CPP CXX CFLAGS CPPFLAGS CXXFLAGS LDFLAGS AR RANLIB RC WINDRES SDL_CFLAGS SDL_LDLIBS; do
|
||||
export "$e=${_mw_[$e]}"
|
||||
done
|
||||
}
|
||||
|
@ -51,9 +51,10 @@ mingw-enable() {
|
|||
|
||||
mw() {
|
||||
if [ "$#" -eq 1 ]; then
|
||||
if [ "$1" -eq 1 ]
|
||||
then; mingw-enable
|
||||
else; mingw-disable
|
||||
if [ "$1" -eq 1 ]; then
|
||||
mingw-enable
|
||||
else
|
||||
mingw-disable
|
||||
fi
|
||||
else
|
||||
if [ $_mw_enabled -eq 0 ]; then
|
||||
|
@ -65,3 +66,4 @@ mw() {
|
|||
fi
|
||||
fi
|
||||
}
|
||||
mw $1
|
Loading…
Add table
Reference in a new issue