Last active
August 27, 2019 03:53
-
-
Save lwzm/f3dfb447f7927b78d70c040aa1c3a5e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmd="$1" | |
dir=$(dirname $(realpath $cmd)) | |
$cmd & | |
pyinstaller_ppid="$!" | |
#echo $pyinstaller_ppid | |
#ps -o pid,ppid | |
#ps uf | |
sleep 0.3 | |
ps -o pid,ppid | awk -v ppid=$pyinstaller_ppid ' | |
$2 == ppid { | |
print $1 | |
} | |
' | xargs lsof -p | awk '{print $9}' | grep '\.so' | grep $dir | |
kill $pyinstaller_ppid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmd=$(realpath "$1") | |
dir=$(dirname $cmd) | |
$cmd & | |
pyinstaller_ppid="$!" | |
#echo $pyinstaller_ppid | |
#ps -o pid,ppid | |
#ps uf | |
sleep 0.3 | |
mkdir -p tmp | |
mkdir -p pre | |
ps -o pid,ppid | awk -v ppid=$pyinstaller_ppid ' | |
$2 == ppid { | |
print $1 | |
} | |
' | xargs lsof -p | awk '{print $9}' | grep '\.so' | grep $dir | xargs -I X cp X tmp | |
kill $pyinstaller_ppid | |
#exit | |
mv $dir/*.so* pre | |
mv tmp/* $dir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment