|
8 | 8 | type InputType = 'file' | 'stdin' | 'command'; |
9 | 9 | type PostType = 'browser' | 'pbcopy'; |
10 | 10 |
|
| 11 | +const clipboardy = require('clipboardy'); |
11 | 12 | const fs = require('fs'); |
| 13 | +const ncp = require('copy-paste'); |
| 14 | +const opn = require('opn'); |
12 | 15 | const os = require('os'); |
13 | 16 | const path = require('path'); |
14 | 17 |
|
15 | 18 | const diff2Html = require('diff2html').Diff2Html; |
16 | | - |
17 | | -var open = require('open'); |
18 | | -var clipboardy = require('clipboardy'); |
19 | | - |
20 | | -const ncp = require('copy-paste'); |
21 | | -const opn = require('opn'); |
| 19 | +const http = require('./http-utils.js').HttpUtils; |
| 20 | +const log = require('./logger.js').Logger; |
| 21 | +const utils = require('./utils.js').Utils; |
22 | 22 |
|
23 | 23 | module.exports = { |
24 | 24 |
|
@@ -159,14 +159,14 @@ module.exports = { |
159 | 159 | } |
160 | 160 |
|
161 | 161 | log.print('Link powered by https://diffy.org'); |
162 | | - log.print(url); |
| 162 | + log.print(response); |
163 | 163 |
|
164 | 164 | if (postType === 'browser') { |
165 | | - open(url); |
166 | | - return callback(null, url); |
| 165 | + opn(response); |
| 166 | + return callback(null, response); |
167 | 167 | } else if (postType === 'pbcopy') { |
168 | | - clipboardy.writeSync(url); |
169 | | - return callback(null, url); |
| 168 | + clipboardy.writeSync(response); |
| 169 | + return callback(null, response); |
170 | 170 | } |
171 | 171 | }); |
172 | 172 | } |
|
0 commit comments