oipage 1.5.0 → 1.6.0-alpha.0

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/CHANGELOG CHANGED
@@ -114,4 +114,13 @@ v1.5.0:
114
114
  * 图片转PDF
115
115
  2、API功能(Node.js)
116
116
  * disk 磁盘相关操作
117
- (包括:moveDisk、listDisk)
117
+ (包括:moveDisk、listDisk)
118
+ v1.6.0:
119
+ date:
120
+ changes:
121
+ - 新增功能
122
+ 1、命令(oipage-cli)
123
+ * disk --link 创建磁盘链接
124
+ 2、API功能(Node.js)
125
+ * disk 磁盘相关操作
126
+ (包括:linkDisk)
package/bin/disk.js CHANGED
@@ -1,4 +1,4 @@
1
- const { deleteDisk, copyDisk, moveDisk } = require("../nodejs/disk");
1
+ const { deleteDisk, copyDisk, moveDisk, linkDisk } = require("../nodejs/disk");
2
2
 
3
3
  module.exports = function (config) {
4
4
  let isForce = false;
@@ -27,5 +27,10 @@ module.exports = function (config) {
27
27
  else if (config.value[i].name === "--copy") {
28
28
  copyDisk(config.value[i].value[0], config.value[i].value[1], isForce);
29
29
  }
30
+
31
+ // 创建磁盘链接
32
+ else if (config.value[i].name === "--link") {
33
+ linkDisk(config.value[i].value[0], config.value[i].value[1], isForce);
34
+ }
30
35
  }
31
36
  };
package/bin/help.js CHANGED
@@ -15,8 +15,9 @@ OIPage@v${packageValue.version}
15
15
  【2】oipage-cli disk 磁盘操作
16
16
  --force|-f 强制执行
17
17
  --delete|-d 删除文件或文件夹
18
- --move|m 移动文件或文件夹
18
+ --move|-m 移动文件或文件夹
19
19
  --copy|-c 复制文件或文件夹
20
+ --linkDisk|-l 创建磁盘链接
20
21
 
21
22
  【3】oipage-cli run "任务一" "任务二" ... 运行多命令
22
23
 
package/bin/run CHANGED
@@ -56,7 +56,8 @@ else if (process.argv[2] === "disk") {
56
56
  "-f": "--force",
57
57
  "-d": "--delete",
58
58
  "-m": "--move",
59
- "-c": "--copy"
59
+ "-c": "--copy",
60
+ "-l": "--link"
60
61
  }, true);
61
62
 
62
63
  require("./disk.js")(argvObj);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * animation of OIPage v1.5.0
2
+ * animation of OIPage v1.6.0-alpha.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * cmdlog of OIPage v1.5.0
2
+ * cmdlog of OIPage v1.6.0-alpha.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -36,4 +36,13 @@ export interface listDiskType {
36
36
  }) => void): void
37
37
  }
38
38
 
39
- export let listDisk: listDiskType
39
+ export let listDisk: listDiskType
40
+
41
+ /**
42
+ * 创建文件或文件夹的链接
43
+ */
44
+ export interface linkDiskType {
45
+ (sourcePath: string, targetPath: string): void
46
+ }
47
+
48
+ export let linkDisk: linkDiskType
@@ -1,10 +1,11 @@
1
1
  /*!
2
- * disk of OIPage v1.5.0
2
+ * disk of OIPage v1.6.0-alpha.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
6
6
  const { join } = require("path");
7
- const { existsSync, readdirSync, lstatSync, unlinkSync, rmdirSync, mkdirSync, copyFileSync } = require("fs");
7
+ const { existsSync, readdirSync, lstatSync, unlinkSync, rmdirSync, mkdirSync, copyFileSync, symlinkSync } = require("fs");
8
+ const { execSync } = require("child_process");
8
9
 
9
10
  /**
10
11
  * 删除文件或文件夹
@@ -156,8 +157,19 @@ function listDisk(sourcePath, callback) {
156
157
  "folder": folder
157
158
  });
158
159
  }
160
+ }
161
+
162
+ /**
163
+ * 软链接文件或文件夹
164
+ * @param {*} sourcePath
165
+ * @param {*} targetPath
166
+ */
167
+ function linkDisk(sourcePath, targetPath) {
168
+ const type = lstatSync(sourcePath).isDirectory() ? 'junction' : 'file';
169
+ symlinkSync(sourcePath, targetPath, type);
159
170
  }
160
171
  exports.deleteDisk = deleteDisk;
161
172
  exports.copyDisk = copyDisk;
162
173
  exports.moveDisk = moveDisk;
163
174
  exports.listDisk = listDisk;
175
+ exports.linkDisk = linkDisk;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * format of OIPage v1.5.0
2
+ * format of OIPage v1.6.0-alpha.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * json of OIPage v1.5.0
2
+ * json of OIPage v1.6.0-alpha.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
  const {reader} = require("../reader/index.js");
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * logform of OIPage v1.5.0
2
+ * logform of OIPage v1.6.0-alpha.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
  const {linelog} = require("../cmdlog/index.js");
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * reader of OIPage v1.5.0
2
+ * reader of OIPage v1.6.0-alpha.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * throttle of OIPage v1.5.0
2
+ * throttle of OIPage v1.6.0-alpha.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oipage",
3
- "version": "1.5.0",
3
+ "version": "1.6.0-alpha.0",
4
4
  "description": "前端网页或应用快速开发助手,包括开发服务器、辅助命令、实用API等",
5
5
  "sideEffects": false,
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * XMLHttpRequest of OIPage v1.5.0
2
+ * XMLHttpRequest of OIPage v1.6.0-alpha.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * animation of OIPage v1.5.0
2
+ * animation of OIPage v1.6.0-alpha.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * format of OIPage v1.5.0
2
+ * format of OIPage v1.6.0-alpha.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
package/web/json/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * json of OIPage v1.5.0
2
+ * json of OIPage v1.6.0-alpha.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
  import {reader} from "../reader/index.js";
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * onReady of OIPage v1.5.0
2
+ * onReady of OIPage v1.6.0-alpha.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * performChunk of OIPage v1.5.0
2
+ * performChunk of OIPage v1.6.0-alpha.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * reader of OIPage v1.5.0
2
+ * reader of OIPage v1.6.0-alpha.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * style of OIPage v1.5.0
2
+ * style of OIPage v1.6.0-alpha.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * throttle of OIPage v1.5.0
2
+ * throttle of OIPage v1.6.0-alpha.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5