Initial commit
This commit is contained in:
0
.scripts/.sync
Normal file
0
.scripts/.sync
Normal file
17
.scripts/lint.sh
Executable file
17
.scripts/lint.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/zsh
|
||||
|
||||
sed -i.bak '/- deadcode/d' .golangci.yml
|
||||
sed -i '' '/- unused/d' .golangci.yml
|
||||
sed -i '' '/- structcheck/d' .golangci.yml
|
||||
|
||||
for d in $(ls)
|
||||
do
|
||||
if [[ $d == hw* ]]; then
|
||||
cd $d
|
||||
echo "Lint ${d}..."
|
||||
golangci-lint run ./...
|
||||
cd ..
|
||||
fi
|
||||
done
|
||||
|
||||
mv .golangci.yml.bak .golangci.yml
|
||||
16
.scripts/sync.sh
Executable file
16
.scripts/sync.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
dst=$1
|
||||
if [[ ! -d "${dst}" ]]; then
|
||||
echo "Usage: ./.scripts/sync.sh <destination dir>."
|
||||
echo "The destination dir should exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
GLOBIGNORE=".:..:.git"
|
||||
for f in *; do
|
||||
[[ -d "${dst}/${f}" ]] && [[ ! -f "${dst}/${f}/.sync" ]] && continue
|
||||
|
||||
echo "syncing ${f}..."
|
||||
cp -R "${f}" "${dst}"
|
||||
done
|
||||
12
.scripts/update.sh
Executable file
12
.scripts/update.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/zsh
|
||||
|
||||
for d in $(ls)
|
||||
do
|
||||
if [[ $d == hw* ]]; then
|
||||
cd $d
|
||||
echo "Update deps in ${d}..."
|
||||
go mod tidy
|
||||
go get -t -u ./...
|
||||
cd ..
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user