This repository has been archived by the owner on Apr 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If the refs database is empty, populate it on startup. Also includes a script to clear it.
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
DB="$(rad path)/node/node.db" | ||
|
||
if command -v sqlite3 >/dev/null 2>&1; then | ||
if [ -f "$DB" ]; then | ||
echo -n "Clearing 'refs' table from $DB.. " | ||
sqlite3 $DB "DELETE FROM refs;" | ||
echo "done." | ||
else | ||
echo "fatal: database file does not exist" | ||
exit 1 | ||
fi | ||
else | ||
echo "fatal: sqlite3 is not installed" | ||
exit 1 | ||
fi |