From a6a9050afc8e154899c2c6cfb938c226cf7afc23 Mon Sep 17 00:00:00 2001 From: Annika Backstrom Date: Sat, 14 Dec 2019 18:56:54 -0500 Subject: [PATCH] Fix Vagrant dev environment Adding the `-L` flag to nodemon, else it doesn't see our changes. --- README.md | 8 ++++++++ Vagrantfile | 10 ++++------ nodemon.json | 1 + package.json | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index bad9c78..a7c2832 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,14 @@ for my own convenience: ## Development +This project supports Vagrant, if you don't want to install the packages +locally: + + vagrant up + vagrant ssh -c 'cd /vagrant && npm run watch' + +You can also just run from the checkout if your environment supports it. + `npm run watch` will use nodemon to restart the server when any file changes. Dummy versions of `mpg321` and the tag reader are available in the `bin` diff --git a/Vagrantfile b/Vagrantfile index 1c4b19d..fe963a2 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,5 +1,5 @@ Vagrant.configure("2") do |config| - config.vm.box = "ubuntu/xenial64" + config.vm.box = "ubuntu/bionic64" config.vm.network :private_network, ip: '10.76.91.201' config.vm.hostname = "jukebox.pi" @@ -15,11 +15,9 @@ Vagrant.configure("2") do |config| cache_dir = local_cache(config.vm.box) config.vm.synced_folder cache_dir, "/var/cache/apt/archives" - config.vm.provision "shell" do |s| - s.inline = "sudo apt update -y" - s.inline = "sudo apt upgrade -y" - s.inline = "sudo apt install -y make nodejs npm nodejs-legacy" - end + config.vm.provision "shell", inline: "sudo apt-get update -y" + config.vm.provision "shell", inline: "sudo apt-get upgrade -y" + config.vm.provision "shell", inline: "sudo apt-get install -y make nodejs npm" end # vim:set ts=2 sw=2 et: diff --git a/nodemon.json b/nodemon.json index 5bb2a40..e842fa1 100644 --- a/nodemon.json +++ b/nodemon.json @@ -5,5 +5,6 @@ , "jukebox" , "templates" , "bin/tag-reader-dummy" + , "config.json" ] } diff --git a/package.json b/package.json index 7441641..4be3cf9 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "url": "https://git.abackstrom.com/annika/pi-rfid-jukebox" }, "scripts": { - "watch": "nodemon player -e js,jade", + "watch": "nodemon -L player -e js,jade", "start": "node player" }, "author": "Annika Backstrom",