Merge pull request #125 from feross/cleanup
Add cleanup script (for developers) (Fix #124)
This commit is contained in:
19
bin/cleanup.js
Executable file
19
bin/cleanup.js
Executable 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)
|
||||||
@@ -1,5 +1,10 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds app binaries for OS X, Linux, and Windows.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var config = require('../config')
|
||||||
var cp = require('child_process')
|
var cp = require('child_process')
|
||||||
var electronPackager = require('electron-packager')
|
var electronPackager = require('electron-packager')
|
||||||
var fs = require('fs')
|
var fs = require('fs')
|
||||||
@@ -30,6 +35,9 @@ var all = {
|
|||||||
// package(s).
|
// package(s).
|
||||||
ignore: /^\/(dist|static\/screenshot.png)$/,
|
ignore: /^\/(dist|static\/screenshot.png)$/,
|
||||||
|
|
||||||
|
// The application name.
|
||||||
|
name: config.APP_NAME,
|
||||||
|
|
||||||
// The base directory where the finished package(s) are created.
|
// The base directory where the finished package(s) are created.
|
||||||
out: path.join(__dirname, '..', 'dist'),
|
out: path.join(__dirname, '..', 'dist'),
|
||||||
|
|
||||||
@@ -68,7 +76,7 @@ var win32 = {
|
|||||||
'version-string': {
|
'version-string': {
|
||||||
|
|
||||||
// Company that produced the file.
|
// Company that produced the file.
|
||||||
CompanyName: 'WebTorrent',
|
CompanyName: config.APP_NAME,
|
||||||
|
|
||||||
// Copyright notices that apply to the file. This should include the full text of all
|
// Copyright notices that apply to the file. This should include the full text of all
|
||||||
// notices, legal symbols, copyright dates, and so on.
|
// notices, legal symbols, copyright dates, and so on.
|
||||||
@@ -83,12 +91,12 @@ var win32 = {
|
|||||||
OriginalFilename: 'WebTorrent.exe',
|
OriginalFilename: 'WebTorrent.exe',
|
||||||
|
|
||||||
// Name of the product with which the file is distributed.
|
// Name of the product with which the file is distributed.
|
||||||
ProductName: 'WebTorrent',
|
ProductName: config.APP_NAME,
|
||||||
|
|
||||||
// Internal name of the file, if one exists, for example, a module name if the file
|
// Internal name of the file, if one exists, for example, a module name if the file
|
||||||
// is a dynamic-link library. If the file has no internal name, this string should be
|
// is a dynamic-link library. If the file has no internal name, this string should be
|
||||||
// the original filename, without extension. This string is required.
|
// the original filename, without extension. This string is required.
|
||||||
InternalName: 'WebTorrent'
|
InternalName: config.APP_NAME
|
||||||
},
|
},
|
||||||
|
|
||||||
// Application icon.
|
// Application icon.
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Update AUTHORS.md based on git history.
|
# Update AUTHORS.md based on git history.
|
||||||
|
|
||||||
git log --reverse --format='%aN <%aE>' | perl -we '
|
git log --reverse --format='%aN <%aE>' | perl -we '
|
||||||
|
|||||||
@@ -30,6 +30,8 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"electron-packager": "^5.0.0",
|
"electron-packager": "^5.0.0",
|
||||||
"electron-prebuilt": "0.36.10",
|
"electron-prebuilt": "0.36.10",
|
||||||
|
"path-exists": "^2.1.0",
|
||||||
|
"rimraf": "^2.5.2",
|
||||||
"standard": "^6.0.5"
|
"standard": "^6.0.5"
|
||||||
},
|
},
|
||||||
"homepage": "https://webtorrent.io",
|
"homepage": "https://webtorrent.io",
|
||||||
@@ -45,6 +47,7 @@
|
|||||||
"url": "git://github.com/feross/webtorrent-app.git"
|
"url": "git://github.com/feross/webtorrent-app.git"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"cleanup": "node ./bin/cleanup.js",
|
||||||
"debug": "DEBUG=* electron .",
|
"debug": "DEBUG=* electron .",
|
||||||
"package": "node ./bin/package.js",
|
"package": "node ./bin/package.js",
|
||||||
"start": "electron .",
|
"start": "electron .",
|
||||||
|
|||||||
Reference in New Issue
Block a user