pterm 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +2 -0
  2. package/package.json +1 -1
  3. package/util.js +14 -0
package/index.js CHANGED
@@ -12,6 +12,8 @@ const util = new Util();
12
12
  let cmd = argv._[0].toLowerCase()
13
13
  if (cmd === "push") {
14
14
  let response = await util.push(argv)
15
+ } else if (cmd === "clipboard") {
16
+ await util.clipboard(argv)
15
17
  } else if (cmd === "version") {
16
18
  if (argv._.length > 1) {
17
19
  let app = argv._[1]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pterm",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
package/util.js CHANGED
@@ -25,6 +25,20 @@ class Util {
25
25
  }
26
26
  })
27
27
  }
28
+ async clipboard(argv) {
29
+ // pinokio clipboard copy <text>
30
+ // pinokio clipboard paste
31
+ if (argv._.length > 1) {
32
+ let payload = { type: argv._[1] }
33
+ if (argv._.length > 2) {
34
+ payload.text = argv._[2]
35
+ }
36
+ let response = await axios.post("http://localhost:42000/clipboard", payload)
37
+ if (response.data && response.data.text) {
38
+ console.log(response.data.text)
39
+ }
40
+ }
41
+ }
28
42
  async push(argv) {
29
43
  if (argv._ && argv._.length > 1 && !argv.message) {
30
44
  argv.message = argv._[1]