| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 parser.addArgument(["-p", "--package"], {required: true}); | 32 parser.addArgument(["-p", "--package"], {required: true}); |
| 33 parser.addArgument(["-c", "--credentials"], {required: true}); | 33 parser.addArgument(["-c", "--credentials"], {required: true}); |
| 34 parser.addArgument(["-t", "--target"], {defaultValue: "dist"}); | 34 parser.addArgument(["-t", "--target"], {defaultValue: "dist"}); |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 exports.run = function(args) | 37 exports.run = function(args) |
| 38 { | 38 { |
| 39 let appIdFromPython = new Promise((resolve, reject) => | 39 let appIdFromPython = new Promise((resolve, reject) => |
| 40 { | 40 { |
| 41 exec( | 41 exec( |
| 42 "python -c \"" + | 42 "python -c \"" + |
|
kzar
2018/10/15 12:42:58
Maybe we should parse the file using JavaScript in
tlucas
2018/10/15 14:12:39
Originally, we would have to support inheritance i
kzar
2018/10/15 14:46:10
Alright, fair enough. Personally, I'd vote for jus
| |
| 43 "from buildtools.chainedconfigparser import ChainedConfigParser; " + | 43 "from buildtools.chainedconfigparser import ChainedConfigParser; " + |
| 44 "p = ChainedConfigParser(); " + | 44 "p = ChainedConfigParser(); " + |
| 45 "p.read('metadata.gecko'); " + | 45 "p.read('metadata.gecko'); " + |
| 46 "print p.get('general', 'app_id_devbuild')\"", | 46 "print p.get('general', 'app_id_devbuild')\"", |
| 47 (error, stdout, stderr) => | 47 (error, stdout, stderr) => |
| 48 { | 48 { |
| 49 if (error) | 49 if (error) |
| 50 { | 50 { |
| 51 console.error(stderr); | 51 console.error(stderr); |
| 52 reject(error); | 52 reject(error); |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 70 return signAddon({ | 70 return signAddon({ |
| 71 xpiPath: args.package, | 71 xpiPath: args.package, |
| 72 version, | 72 version, |
| 73 apiKey: auth["AMO_KEY"], | 73 apiKey: auth["AMO_KEY"], |
| 74 apiSecret: auth["AMO_SECRET"], | 74 apiSecret: auth["AMO_SECRET"], |
| 75 channel: "unlisted", | 75 channel: "unlisted", |
| 76 id: appId | 76 id: appId |
| 77 }); | 77 }); |
| 78 }).then(result => | 78 }).then(result => |
| 79 { | 79 { |
| 80 // signAddon writes failure reasons directly to the shell, so we don't have | |
| 81 // to take care about logging the error messages. | |
| 80 if (!result.success) | 82 if (!result.success) |
| 81 process.exit(1); | 83 process.exit(1); |
|
kzar
2018/10/15 12:42:58
Should we instead throw an exception here, so it's
tlucas
2018/10/15 14:12:39
Sebastian also asked if we could log something her
kzar
2018/10/15 14:46:10
I see, that's a little misleading but it's not you
tlucas
2018/10/16 08:42:39
Done.
| |
| 82 | 84 |
| 83 let fullName = result.downloadedFiles[0]; | 85 let fullName = result.downloadedFiles[0]; |
| 84 let newName = path.join(args.target, path.basename(fullName)); | 86 let newName = path.join(args.target, path.basename(fullName)); |
| 85 | 87 |
| 86 return mvFileAsync(fullName, newName, {mkdirp: true}); | 88 return mvFileAsync(fullName, newName, {mkdirp: true}); |
| 87 }).catch(err => | 89 }).catch(err => |
| 88 { | 90 { |
| 89 console.error(err); | 91 console.error(err); |
| 90 process.exit(1); | 92 process.exit(1); |
| 91 }); | 93 }); |
| 92 }; | 94 }; |
| LEFT | RIGHT |