Implemented serve and copy-link development features
This commit is contained in:
parent
48a50320a8
commit
3dcffe7cef
7 changed files with 1214 additions and 4 deletions
21
tasks/copy-link.js
Normal file
21
tasks/copy-link.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
"use strict"
|
||||
|
||||
import "dotenv/config"
|
||||
|
||||
import clipboard from "clipboardy"
|
||||
|
||||
if (process.argv.length !== 3 || !process.argv[2].match(/http(s)?:\/\//)) {
|
||||
console.info("Usage: node copy-link.js selectedText")
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
var text = process.argv[2]
|
||||
|
||||
if (process.env.LOCALHOST_PROXY) {
|
||||
text = text.replace(
|
||||
"https://raw.githubusercontent.com/sunknudsen/privacy-guides/master",
|
||||
process.env.LOCALHOST_PROXY
|
||||
)
|
||||
}
|
||||
|
||||
clipboard.write(text)
|
Loading…
Add table
Add a link
Reference in a new issue