Added upload script

This commit is contained in:
Ben Ashton 2022-09-05 22:58:49 -06:00
parent bcf3b8dd7f
commit c5a31b40d1
2 changed files with 21 additions and 4 deletions

View File

@ -71,20 +71,20 @@ $ }
# $1: string: restaurant to remove
$ remove_restaurant () {
$ enforce_arguments "${FUNCNAME[0]}" "$#" 1;
$ cat "$restaurant_file" | grep -Fxv "$1" | tee "$restaurant_file" >/dev/null;
$ grep -Fxv "$1" "$restaurant_file" | tee "$restaurant_file" >/dev/null;
$ }
#
# $1: string: restuarant to add
$ add_restaurant () {
$ enforce_arguments "${FUNCNAME[0]}" "$#" 1;
$ cat "$restaurant_file" |\
$ (grep -Fxv "$1"; printf '%s\n' "$1") |\
$ (grep -Fxv "$1" "$restaurant_file"; printf '%s\n' "$1") |\
$ tee "$restaurant_file" >/dev/null;
$ }
#
# $1 (optional): number: 0=don't overwrite, 1=overwrite
$ todays_restaurant () {
$ local today="$(date +'%Y%m%d')";
$ local today;
$ today="$(date +'%Y%m%d')";
$ local filename="$today.pick";
$ if [ -n "$1" ] && [ "$1" -ne 0 ]; then
$ rm "$filename";

17
package.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "feedme",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"upload": "rsync -avH --exclude '.git' --exclude 'package.json' -e 'ssh -p 24' ./ ben@n0m.org:/home/ben/n0m/current/files/feedme/",
"shellcheck": "/bin/bash -c \"shellcheck <(n0m -c index.n0m)\"",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "ssh://git@git.n0m.org:24/n0m/FeedMe.git"
},
"author": "",
"license": "ISC"
}