onepage-cli 1.0.0 → 1.0.1
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.
- package/README.md +5 -3
- package/lib/config.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,13 +59,15 @@ op push # 部署上线(交互式输入短链名、预览图、公开、SEO
|
|
|
59
59
|
|
|
60
60
|
```json
|
|
61
61
|
{
|
|
62
|
-
"server": "https://
|
|
62
|
+
"server": "https://app.collegehub.cn",
|
|
63
63
|
"token": "...",
|
|
64
64
|
"username": "...",
|
|
65
65
|
"email": "..."
|
|
66
66
|
}
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
+
默认服务器为 `https://app.collegehub.cn`;如需指向其他地址,设置环境变量 `OP_SERVER=https://xxx` 后重新 `op login`。
|
|
70
|
+
|
|
69
71
|
## 典型工作流
|
|
70
72
|
|
|
71
73
|
```bash
|
|
@@ -78,13 +80,13 @@ op init && op add . && op push
|
|
|
78
80
|
# → 预览图路径(no 跳过): no
|
|
79
81
|
# → 是否公开(yes/no): yes
|
|
80
82
|
# → 是否 SEO 优化(yes/no): yes
|
|
81
|
-
# ✓ 部署完成:https://
|
|
83
|
+
# ✓ 部署完成:https://app.collegehub.cn/my-site/
|
|
82
84
|
|
|
83
85
|
# 更新:改完代码再 add + push(短链名不变即覆盖更新)
|
|
84
86
|
op add . && op push
|
|
85
87
|
|
|
86
88
|
# 备份/迁移
|
|
87
|
-
op clone https://
|
|
89
|
+
op clone https://app.collegehub.cn/my-site/
|
|
88
90
|
```
|
|
89
91
|
|
|
90
92
|
## 安全说明
|
package/lib/config.js
CHANGED
|
@@ -5,7 +5,10 @@ const path = require('path');
|
|
|
5
5
|
const os = require('os');
|
|
6
6
|
|
|
7
7
|
const CONF_PATH = path.join(os.homedir(), '.onepage-cli.json');
|
|
8
|
-
const DEFAULTS = {
|
|
8
|
+
const DEFAULTS = {
|
|
9
|
+
server: process.env.OP_SERVER || 'https://app.collegehub.cn',
|
|
10
|
+
token: '', username: '', email: '',
|
|
11
|
+
};
|
|
9
12
|
|
|
10
13
|
function load() {
|
|
11
14
|
try {
|