td-octopus 0.0.15 → 0.0.17

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/cmds/back.js ADDED
@@ -0,0 +1,9 @@
1
+ const { back } = require('../src/back');
2
+
3
+ exports.command = 'back';
4
+
5
+ exports.describe = 'back 将项目中已经翻译的部分回滚回去';
6
+
7
+ exports.handler = () => {
8
+ back()
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "td-octopus",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "I18N tool",
5
5
  "author": "Anthony Li",
6
6
  "bin": {
package/src/back/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * @Author: 郑泳健
4
4
  * @Date: 2022-06-01 13:56:18
5
5
  * @LastEditors: 郑泳健
6
- * @LastEditTime: 2023-01-11 11:07:41
6
+ * @LastEditTime: 2023-01-11 15:14:00
7
7
  */
8
8
  const path = require('path')
9
9
  const fs = require('fs')
@@ -151,7 +151,8 @@ const { getProjectConfig } = require('../utils/index')
151
151
  if (Array.isArray(matchList) && matchList.length) {
152
152
  sum += matchList.length;
153
153
  matchList.forEach(({ key, value }) => {
154
- code = code.replace(key, "'" + value + "'")
154
+ const replaceVal = value && value.includes("'") ? '"' + value + '"' : "'" + value + "'"
155
+ code = code.replace(key, replaceVal)
155
156
  })
156
157
  }
157
158