Skip to content

Commit

Permalink
Library disable and enable script
Browse files Browse the repository at this point in the history
        new file:   lib/disable.sh
        new file:   lib/enable.sh
  • Loading branch information
MarrekNozka committed Feb 6, 2023
1 parent 9f36946 commit 87382fb
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/disable.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

cd $(dirname $0)/..

name=$(basename $1 .h)
name=$(basename $name .c)

inc_h=inc/${name}.h
src_c=src/${name}.c
lib_h=lib/${name}.h
lib_c=lib/${name}.c

if [ -f $lib_h -o -f $lib_c ]; then
date=$(date +"%y%m%d%H%M%S")
[ -f $inc_h ] && mv -v $inc_h $(basename $lib_h .h)-${date}.h
[ -f $src_c ] && mv -v $src_c $(basename $lib_c .c)-${date}.h
else
[ -f $inc_h ] && mv -v $inc_h lib
[ -f $src_c ] && mv -v $src_c lib
fi

18 changes: 18 additions & 0 deletions lib/enable.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

cd $(dirname $0)/..

name=$(basename $1 .h)
name=$(basename $name .c)

lib_h=lib/${name}.h
lib_c=lib/${name}.c

if [ -f $lib_h ]; then
cp -v $lib_h inc
fi

if [ -f $lib_c ]; then
cp -v $lib_c src
fi

0 comments on commit 87382fb

Please sign in to comment.