@pisell/common 0.0.18-0 → 0.0.18-2

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.
@@ -96,7 +96,7 @@ function _init() {
96
96
 
97
97
  // 删除本地在远程不存在的tag
98
98
  _context.next = 9;
99
- return $(_templateObject || (_templateObject = _taggedTemplateLiteral(["git fetch --prune --prune-tags"])));
99
+ return $(_templateObject || (_templateObject = _taggedTemplateLiteral(["git fetch --prune-tags"])));
100
100
  case 9:
101
101
  uploadCode = new UploadCode(res);
102
102
  _context.next = 12;
@@ -5,6 +5,7 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
5
5
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
6
6
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
7
7
  import * as dotenv from 'dotenv';
8
+ import path from 'path';
8
9
  import ssh2 from 'ssh2';
9
10
 
10
11
  /**
@@ -237,10 +238,10 @@ var versionSort = function versionSort(versionList) {
237
238
  * @returns {*}
238
239
  */
239
240
  var getCurrentProjectName = function getCurrentProjectName() {
240
- return loadJSON("".concat(process.cwd(), "/package.json")).name;
241
+ return loadJSON(path.join(process.cwd(), './package.json')).name;
241
242
  };
242
243
  var loadJSON = function loadJSON(path) {
243
- return JSON.parse(fs.readFileSync(new URL(path, import.meta.url)));
244
+ return JSON.parse(fs.readFileSync(path));
244
245
  };
245
246
  var getCurrentUserName = /*#__PURE__*/function () {
246
247
  var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
@@ -100,7 +100,7 @@ async function init() {
100
100
  path: "./",
101
101
  fileName: (0, import_utils.getCurrentProjectName)()
102
102
  };
103
- await $`git fetch --prune --prune-tags`;
103
+ await $`git fetch --prune-tags`;
104
104
  const uploadCode = new import_uploadCode.default(res);
105
105
  if (!await uploadCode.check()) {
106
106
  return;
@@ -44,8 +44,8 @@ __export(utils_exports, {
44
44
  });
45
45
  module.exports = __toCommonJS(utils_exports);
46
46
  var dotenv = __toESM(require("dotenv"));
47
+ var import_path = __toESM(require("path"));
47
48
  var import_ssh2 = __toESM(require("ssh2"));
48
- var import_meta = {};
49
49
  var isWorkingTreeClean = async () => {
50
50
  const v = await $`git status --porcelain`;
51
51
  return v.stdout === "";
@@ -112,7 +112,7 @@ var serverUpload = (conn, { localPath, remotePath }) => {
112
112
  });
113
113
  });
114
114
  };
115
- var serverUnpack = (conn, { path, fileName, fullFileName, changelog }) => {
115
+ var serverUnpack = (conn, { path: path2, fileName, fullFileName, changelog }) => {
116
116
  if (!conn)
117
117
  return Promise.reject("未连接服务器");
118
118
  return new Promise((resolve, reject) => {
@@ -124,7 +124,7 @@ var serverUnpack = (conn, { path, fileName, fullFileName, changelog }) => {
124
124
  }
125
125
  stream.end(
126
126
  `
127
- cd ${path}
127
+ cd ${path2}
128
128
  unzip ${fullFileName} -d ${fileName} && mv ${fileName}/dist/* ${fileName}/ && rmdir ${fileName}/dist
129
129
  rm -rf ${fullFileName}
130
130
  echo "${changelog}" > ./${fileName}/changelog.md
@@ -145,7 +145,7 @@ var serverUnpack = (conn, { path, fileName, fullFileName, changelog }) => {
145
145
  });
146
146
  });
147
147
  };
148
- var releaseProject = (conn, { path, fileName }) => {
148
+ var releaseProject = (conn, { path: path2, fileName }) => {
149
149
  return new Promise((resolve, reject) => {
150
150
  conn.shell((err, stream) => {
151
151
  if (err) {
@@ -155,7 +155,7 @@ var releaseProject = (conn, { path, fileName }) => {
155
155
  }
156
156
  stream.end(
157
157
  `
158
- cd ${path}
158
+ cd ${path2}
159
159
  cp -R -f pre-master next-master
160
160
  rm -rf pre-master
161
161
  \\cp -R -f ${fileName}/* next-master
@@ -197,9 +197,9 @@ var versionSort = (versionList) => {
197
197
  });
198
198
  };
199
199
  var getCurrentProjectName = () => {
200
- return loadJSON(`${process.cwd()}/package.json`).name;
200
+ return loadJSON(import_path.default.join(process.cwd(), "./package.json")).name;
201
201
  };
202
- var loadJSON = (path) => JSON.parse(fs.readFileSync(new URL(path, import_meta.url)));
202
+ var loadJSON = (path2) => JSON.parse(fs.readFileSync(path2));
203
203
  var getCurrentUserName = async () => {
204
204
  const { stdout } = await $`git config user.name`;
205
205
  return stdout;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/common",
3
- "version": "0.0.18-0",
3
+ "version": "0.0.18-2",
4
4
  "description": "A collection of reusable UI components for web development",
5
5
  "license": "MIT",
6
6
  "sideEffects": [