{"action":"created","issue":{"url":"https://api.github.com/repos/internetarchive/FirefoxNoMore404s/issues/22","repository_url":"https://api.github.com/repos/internetarchive/FirefoxNoMore404s","labels_url":"https://api.github.com/repos/internetarchive/FirefoxNoMore404s/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/internetarchive/FirefoxNoMore404s/issues/22/comments","events_url":"https://api.github.com/repos/internetarchive/FirefoxNoMore404s/issues/22/events","html_url":"https://github.com/internetarchive/FirefoxNoMore404s/issues/22","id":166942430,"number":22,"title":"A couple errors when using `npm run build_unsigned`","user":{"login":"pdehaan","id":557895,"avatar_url":"https://avatars.githubusercontent.com/u/557895?v=3","gravatar_id":"","url":"https://api.github.com/users/pdehaan","html_url":"https://github.com/pdehaan","followers_url":"https://api.github.com/users/pdehaan/followers","following_url":"https://api.github.com/users/pdehaan/following{/other_user}","gists_url":"https://api.github.com/users/pdehaan/gists{/gist_id}","starred_url":"https://api.github.com/users/pdehaan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdehaan/subscriptions","organizations_url":"https://api.github.com/users/pdehaan/orgs","repos_url":"https://api.github.com/users/pdehaan/repos","events_url":"https://api.github.com/users/pdehaan/events{/privacy}","received_events_url":"https://api.github.com/users/pdehaan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-21T23:45:17Z","updated_at":"2016-07-21T23:51:15Z","closed_at":null,"body":"Currently it looks like I get errors the first time I run `$ npm run build_unsigned` because the `./build_unsigned/` directory does not exist:\r\n\r\n```sh\r\n$ npm run build_unsigned\r\n\r\n> FirefoxNoMore404s@1.4.3 build_unsigned /Users/pdehaan/dev/github/FirefoxNoMore404s\r\n> mkdir build_unsigned && rm ./build_unsigned/*.zip && web-ext build --source-dir=src --artifacts-dir=build_unsigned\r\n\r\nrm: ./build_unsigned/*.zip: No such file or directory\r\n\r\n$ echo $? # 1\r\n```\r\n\r\nAfter running once, the directory is automatically created, and then running `$ npm run build_unsigned` fails again with a different error, because now `mkdir` fails:\r\n\r\n```sh\r\n$ npm run build_unsigned\r\n\r\n> FirefoxNoMore404s@1.4.3 build_unsigned /Users/pdehaan/dev/github/FirefoxNoMore404s\r\n> mkdir build_unsigned && rm ./build_unsigned/*.zip && web-ext build --source-dir=src --artifacts-dir=build_unsigned\r\n\r\nmkdir: build_unsigned: File exists\r\n\r\n$ echo $? # 1\r\n```\r\n\r\nI was able to hack it together locally by adding a `-p` flag to `mkdir` and a risky `-f` flag to `rm`:\r\n\r\n```js\r\n\"build_unsigned\": \"mkdir -p build_unsigned && rm -f ./build_unsigned/*.zip && web-ext build --source-dir=src --artifacts-dir=build_unsigned\",\r\n```\r\n\r\nNow it looks like I can build multiple times in a row without any blocking errors:\r\n\r\n```sh\r\n$ npm run build_unsigned\r\n\r\n> FirefoxNoMore404s@1.4.3 build_unsigned /Users/pdehaan/dev/github/FirefoxNoMore404s\r\n> mkdir -p build_unsigned && rm -f ./build_unsigned/*.zip && web-ext build --source-dir=src --artifacts-dir=build_unsigned\r\n\r\nBuilding web extension from /Users/pdehaan/dev/github/FirefoxNoMore404s/src\r\nYour web extension is ready: build_unsigned/no_more_404s-1.4.4.zip\r\n```\r\n\r\nWe may also be reverse the order of the commands to do:\r\n\r\n1. `rm -f ./build_unsigned` &mdash; force delete entire folder, whether it exists or not.\r\n1. `mkdir build_unsigned` &mdash; recreate an empty artifact directory (since we're probably guaranteed that it won't exist after our terrifying `rm -f` in step 1).\r\n1. `web-ext build --source-dir=src --artifacts-dir=build_unsigned` &mdash; go ahead and recreate the web extension in our empty artifact directory.\r\n\r\n---\r\n\r\nBoth `rm` and `mkdir` are probably pretty Unix/macOS specific, but I guess we could technically use something like [**rimraf**](http://npm.im/rimraf) and [**mkdirp**](http://npm.im/mkdirp) if we wanted to be a bit more Windows friendly (at the cost of adding two new devDependencies)."},"comment":{"url":"https://api.github.com/repos/internetarchive/FirefoxNoMore404s/issues/comments/234417935","html_url":"https://github.com/internetarchive/FirefoxNoMore404s/issues/22#issuecomment-234417935","issue_url":"https://api.github.com/repos/internetarchive/FirefoxNoMore404s/issues/22","id":234417935,"user":{"login":"rchrd2","id":182479,"avatar_url":"https://avatars.githubusercontent.com/u/182479?v=3","gravatar_id":"","url":"https://api.github.com/users/rchrd2","html_url":"https://github.com/rchrd2","followers_url":"https://api.github.com/users/rchrd2/followers","following_url":"https://api.github.com/users/rchrd2/following{/other_user}","gists_url":"https://api.github.com/users/rchrd2/gists{/gist_id}","starred_url":"https://api.github.com/users/rchrd2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rchrd2/subscriptions","organizations_url":"https://api.github.com/users/rchrd2/orgs","repos_url":"https://api.github.com/users/rchrd2/repos","events_url":"https://api.github.com/users/rchrd2/events{/privacy}","received_events_url":"https://api.github.com/users/rchrd2/received_events","type":"User","site_admin":false},"created_at":"2016-07-21T23:51:15Z","updated_at":"2016-07-21T23:51:15Z","body":"Yes. I noticed this to. I am building and signing a new version. I'll resolve these and get back to you."}}
{"actor":{"display_login":"rchrd2"}}