lindows/scripts/copylib
2024-03-01 08:25:41 -05:00

13 lines
566 B
Bash
Executable File

#!/bin/sh
# ARG 1: LIB PATH
# copy libs
find $1/bin $1/lib -type d | sed -r 's/'$1'\/(bin|lib)\///;Tn;s/^/mkdir lindows_c\/Windows\/System32\//;by;:n;d;:y;e' > /dev/null;
find $1/bin -type f | sed -r 's/'$1'\/bin\/(.*)/cp '$1'\/bin\/\1 lindows_c\/Windows\/System32\/\1.exe/;e' > /dev/null
find $1/lib -type f | sed -r 's/'$1'\/lib\/(.*)/cp '$1'\/lib\/\1 lindows_c\/Windows\/System32\/\1/;e' > /dev/null
# copy lib links
for lib in $(cd $1/lib && find -type l); do
ln -sr "lindows_c/Windows/System32/$(readlink $1/lib/$lib)" "lindows_c/Windows/System32/$lib"
done