File tree Expand file tree Collapse file tree 5 files changed +15
-3
lines changed
lib/src/main/java/com/diffplug/spotless/npm Expand file tree Collapse file tree 5 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
14
14
* Update ktfmt from 0.21 to 0.24
15
15
### Fixed
16
16
* The ` <url> ` field in the maven POM is now set correctly ([ #798 ] ( https://github.com/diffplug/spotless/issues/798 ) )
17
+ * Node is re-installed if some other build step removed it ([ #863 ] ( https://github.com/diffplug/spotless/issues/863 ) )
17
18
18
19
## [ 2.13.4] - 2021-04-21
19
20
### Fixed
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2020 DiffPlug
2
+ * Copyright 2020-2021 DiffPlug
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -46,4 +46,8 @@ File serveJsFile() {
46
46
public File npmrcFile () {
47
47
return npmrcFile ;
48
48
}
49
+
50
+ static File getBuildDirFromNodeModulesDir (File nodeModulesDir ) {
51
+ return nodeModulesDir .getParentFile ();
52
+ }
49
53
}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2016-2020 DiffPlug
2
+ * Copyright 2016-2021 DiffPlug
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -85,7 +85,11 @@ private void runNpmInstall(File npmProjectDir) throws IOException {
85
85
new NpmProcess (npmProjectDir , this .npmExecutable ).install ();
86
86
}
87
87
88
- protected ServerProcessInfo npmRunServer () throws ServerStartException {
88
+ protected ServerProcessInfo npmRunServer () throws ServerStartException , IOException {
89
+ if (!this .nodeModulesDir .exists ()) {
90
+ prepareNodeServer (NodeServerLayout .getBuildDirFromNodeModulesDir (this .nodeModulesDir ));
91
+ }
92
+
89
93
try {
90
94
// The npm process will output the randomly selected port of the http server process to 'server.port' file
91
95
// so in order to be safe, remove such a file if it exists before starting.
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
7
7
* Update ktfmt from 0.21 to 0.24
8
8
### Fixed
9
9
* The ` <url> ` field in the maven POM is now set correctly ([ #798 ] ( https://github.com/diffplug/spotless/issues/798 ) )
10
+ * Node is re-installed if some other build step removed it ([ #863 ] ( https://github.com/diffplug/spotless/issues/863 ) )
10
11
11
12
## [ 5.12.4] - 2021-04-21
12
13
### Fixed
Original file line number Diff line number Diff line change 3
3
We adhere to the [ keepachangelog] ( https://keepachangelog.com/en/1.0.0/ ) format (starting after version ` 1.27.0 ` ).
4
4
5
5
## [ Unreleased]
6
+ ### Fixed
7
+ * Node is re-installed if some other build step removed it ([ #863 ] ( https://github.com/diffplug/spotless/issues/863 ) )
6
8
7
9
## [ 2.11.0] - 2021-05-03
8
10
### Added
You can’t perform that action at this time.
0 commit comments