Browse Source

Added upload script

master
Ben Ashton 2 years ago
parent
commit
c5a31b40d1
  1. 8
      index.n0m
  2. 17
      package.json

8
index.n0m

@ -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

@ -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"
}
Loading…
Cancel
Save