Add cleanup script (for developers) (Fix #124)

This commit is contained in:
Feross Aboukhadijeh
2016-03-10 15:18:02 -08:00
parent f740195ce4
commit fbddb0c98b
3 changed files with 23 additions and 0 deletions

19
bin/cleanup.js Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env node
/**
* Remove all traces of WebTorrent.app from the system (config and temp files).
* Useful for developers.
*/
var applicationConfigPath = require('application-config-path')
var config = require('../config')
var os = require('os')
var path = require('path')
var pathExists = require('path-exists')
var rimraf = require('rimraf')
var tmpPath = path.join(pathExists.sync('/tmp') ? '/tmp' : os.tmpDir(), 'webtorrent')
var configPath = applicationConfigPath(config.APP_NAME)
rimraf.sync(configPath)
rimraf.sync(tmpPath)

View File

@@ -1,4 +1,5 @@
#!/bin/sh
# Update AUTHORS.md based on git history.
git log --reverse --format='%aN <%aE>' | perl -we '

View File

@@ -30,6 +30,8 @@
"devDependencies": {
"electron-packager": "^5.0.0",
"electron-prebuilt": "0.36.10",
"path-exists": "^2.1.0",
"rimraf": "^2.5.2",
"standard": "^6.0.5"
},
"homepage": "https://webtorrent.io",
@@ -45,6 +47,7 @@
"url": "git://github.com/feross/webtorrent-app.git"
},
"scripts": {
"cleanup": "node ./bin/cleanup.js",
"debug": "DEBUG=* electron .",
"package": "node ./bin/package.js",
"start": "electron .",