Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimba Zhang <solderzzc@gmail.com>2015-07-30 01:30:19 +0300
committerSimba Zhang <solderzzc@gmail.com>2015-07-30 01:30:19 +0300
commitb75d0485885f340cc6411839e9c0bc8bc4788bda (patch)
tree84902a7cb562784f71334ed53842c64d49934da0 /bin/cmd.js
parent45c3250d132b4a680a103a3c86cf5e83b0b65ef4 (diff)
Fixed for CI Style check
Diffstat (limited to 'bin/cmd.js')
-rwxr-xr-xbin/cmd.js25
1 files changed, 12 insertions, 13 deletions
diff --git a/bin/cmd.js b/bin/cmd.js
index 643d776..bd91b5f 100755
--- a/bin/cmd.js
+++ b/bin/cmd.js
@@ -95,19 +95,18 @@ if (argv.subtitles) {
OMX_EXEC += ' --subtitles ' + argv.subtitles
}
-function checkPermission(filename){
+function checkPermission (filename) {
try {
var stats = fs.lstatSync(filename)
if (!stats.isFile()) {
- errorAndExit("Your script "+ filename +" is not exist")
+ errorAndExit('Your script ' + filename + ' is not exist')
}
// check if the script has executable permission
- if(!(1 & parseInt ((stats.mode & parseInt ("777", 8)).toString (8)[0]))){
- errorAndExit(filename+" don't have executable permission")
+ if (!(1&parseInt((stats.mode & parseInt('777', 8)).toString(8)[0]))) {
+ errorAndExit(filename + ' don\'t have executable permission')
}
return fs.realpathSync(filename)
- }
- catch (err) {
+ } catch (err) {
errorAndExit(err)
}
}
@@ -612,21 +611,21 @@ function drawTorrent (torrent) {
clivas.flush(true)
}
}
-function getTorrentInfo(){
+function getTorrentInfo () {
var params = []
- if (client){
+ if (client) {
var torrent = client.torrents[0]
- if (torrent){
- var torrentFilename=path.join(torrent.storage.path,torrent.infoHash)+'.torrent'
+ if (torrent) {
+ var torrentFilename = path.join(torrent.storage.path, torrent.infoHash) + '.torrent'
try {
fs.writeFileSync(torrentFilename, torrent.torrentFile)
- } catch(err){
- torrentFilename = ""
+ } catch(err) {
+ torrentFilename = ''
}
params.push(torrentFilename)
- params.push(path.join(torrent.storage.path,torrent.name))
+ params.push(path.join(torrent.storage.path, torrent.name))
params.push(torrent.magnetURI)
}
}