@qse/edu-scripts 1.12.2 → 1.12.3

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.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # 更新日志
2
2
 
3
+ ## 1.12.3 (2022-11-01)
4
+
5
+ - fix: 修复 commit-dist 错误
6
+
3
7
  ## 1.12.2 (2022-09-29)
4
8
 
5
9
  - feat: 校验 version 字段
package/lib/build.js CHANGED
@@ -59,10 +59,6 @@ module.exports = async function build(args) {
59
59
  errors: true,
60
60
  colors: true
61
61
  }));
62
- } // Fail the build if running in a CI server
63
-
64
-
65
- if (error || stats.compilation.errors.length) {
66
62
  process.exit(1);
67
63
  }
68
64
 
@@ -14,8 +14,6 @@ const exec = (cmd, opts) => require('child_process').execSync(cmd, {
14
14
 
15
15
  const tmp = require('tmp');
16
16
 
17
- const glob = require('globby');
18
-
19
17
  function validateSVNRoot(root) {
20
18
  const ls = exec(`svn ls ${root}`);
21
19
  return ['trunk', 'branches'].every(s => ls.includes(s));
@@ -67,17 +65,15 @@ function copyDistToRepo(info) {
67
65
  }
68
66
 
69
67
  exec(`svn co ${info.distBranchDirURL} ${tmpdir}`);
70
- let files = glob.sync('**/*', {
71
- cwd: tmpdir
72
- });
73
- exec(`svn rm "${files.join('" "')}"`, {
74
- cwd: tmpdir
75
- });
68
+
69
+ try {
70
+ exec(`svn rm * --force -q`, {
71
+ cwd: tmpdir
72
+ });
73
+ } catch (error) {}
74
+
76
75
  fs.copySync(paths.dist, tmpdir);
77
- files = glob.sync('**/*', {
78
- cwd: tmpdir
79
- });
80
- exec(`svn add "${files.join('" "')}"`, {
76
+ exec(`svn add * --force --auto-props --parents --depth infinity -q`, {
81
77
  cwd: tmpdir
82
78
  });
83
79
  const msg = `[edu-scripts] commit ${info.branch} dist #${info.revision} @${info.author}`;
@@ -275,7 +275,6 @@ module.exports = function getWebpackConfig(args, override) {
275
275
  }, {
276
276
  loader: 'url-loader',
277
277
  options: {
278
- name: `images/${assetPath}/[name].[hash:6].[ext]`,
279
278
  limit: imageInlineSizeLimit
280
279
  }
281
280
  }],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qse/edu-scripts",
3
- "version": "1.12.2",
3
+ "version": "1.12.3",
4
4
  "author": "Kinoko",
5
5
  "license": "MIT",
6
6
  "description": "教育工程化基础框架",
package/src/build.js CHANGED
@@ -44,10 +44,6 @@ module.exports = async function build(args) {
44
44
  if (stats.compilation.errors.length) {
45
45
  console.log(chalk.red('编译失败'))
46
46
  console.log(stats.toString({ all: false, errors: true, colors: true }))
47
- }
48
-
49
- // Fail the build if running in a CI server
50
- if (error || stats.compilation.errors.length) {
51
47
  process.exit(1)
52
48
  }
53
49
 
@@ -4,7 +4,6 @@ const fs = require('fs-extra')
4
4
  const exec = (cmd, opts) =>
5
5
  require('child_process').execSync(cmd, { encoding: 'utf-8', stdio: 'pipe', ...opts })
6
6
  const tmp = require('tmp')
7
- const glob = require('globby')
8
7
 
9
8
  function validateSVNRoot(root) {
10
9
  const ls = exec(`svn ls ${root}`)
@@ -49,13 +48,13 @@ function copyDistToRepo(info) {
49
48
  }
50
49
  exec(`svn co ${info.distBranchDirURL} ${tmpdir}`)
51
50
 
52
- let files = glob.sync('**/*', { cwd: tmpdir })
53
- exec(`svn rm "${files.join('" "')}"`, { cwd: tmpdir })
51
+ try {
52
+ exec(`svn rm * --force -q`, { cwd: tmpdir })
53
+ } catch (error) {}
54
54
 
55
55
  fs.copySync(paths.dist, tmpdir)
56
56
 
57
- files = glob.sync('**/*', { cwd: tmpdir })
58
- exec(`svn add "${files.join('" "')}"`, { cwd: tmpdir })
57
+ exec(`svn add * --force --auto-props --parents --depth infinity -q`, { cwd: tmpdir })
59
58
 
60
59
  const msg = `[edu-scripts] commit ${info.branch} dist #${info.revision} @${info.author}`
61
60
  exec(`svn ci -m "${msg}"`, { cwd: tmpdir })
@@ -290,7 +290,6 @@ module.exports = function getWebpackConfig(args, override) {
290
290
  {
291
291
  loader: 'url-loader',
292
292
  options: {
293
- name: `images/${assetPath}/[name].[hash:6].[ext]`,
294
293
  limit: imageInlineSizeLimit,
295
294
  },
296
295
  },