Adds secret loading
This commit is contained in:
parent
cbf899eb40
commit
63fcd502a8
5 changed files with 81 additions and 30 deletions
|
|
@ -1,28 +1,32 @@
|
|||
#!/bin/env sh
|
||||
|
||||
foundSymlinks=false
|
||||
handleYadmSymlinks() {
|
||||
foundSymlinks=false
|
||||
|
||||
for file in $(yadm diff --name-only --cached); do
|
||||
lsResult=$(ls -1 -l "$file")
|
||||
if [[ $lsResult != *"->"* ]]; then
|
||||
continue
|
||||
for file in $(yadm diff --name-only --cached); do
|
||||
lsResult=$(ls -1 -l "$file")
|
||||
if [[ $lsResult != *"->"* ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
symlinkTarget=$(echo "$lsResult" | awk '{print $NF}')
|
||||
|
||||
if [[ $lsResult != *"##"* ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "$file is a YADM symlink. Telling git to ignore it..."
|
||||
|
||||
yadm restore --staged "$file"
|
||||
echo "$file" >>~/.gitignore
|
||||
|
||||
foundSymlinks=true
|
||||
done
|
||||
|
||||
if [ $foundSymlinks ]; then
|
||||
echo "Symlinks found. Adding .gitignore to commit..."
|
||||
yadm add ~/.gitignore
|
||||
fi
|
||||
}
|
||||
|
||||
symlinkTarget=$(echo "$lsResult" | awk '{print $NF}')
|
||||
|
||||
if [[ $lsResult != *"##"* ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "$file is a YADM symlink. Telling git to ignore it..."
|
||||
|
||||
yadm restore --staged "$file"
|
||||
echo "$file" >>~/.gitignore
|
||||
|
||||
foundSymlinks=true
|
||||
done
|
||||
|
||||
if [ $foundSymlinks ]; then
|
||||
echo "Symlinks found. Adding .gitignore to commit..."
|
||||
yadm add ~/.gitignore
|
||||
fi
|
||||
handleYadmSymlinks
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue