Skip to content

Commit 1152f2b

Browse files
committed
feat: allow ./ in the file pattern
Use path.posix.normalize
1 parent 505a63d commit 1152f2b

File tree

5 files changed

+343
-24
lines changed

5 files changed

+343
-24
lines changed

CHANGELOG.md

Lines changed: 313 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,323 @@
22
To see changes for current major release, please use [GiHub releases](https://github.com/electron-userland/electron-builder/releases).
33

44

5+
<a name=""></a>
6+
# [](https://github.com/electron-userland/electron-builder/compare/v12.0.3...v) (2017-01-29)
7+
8+
9+
10+
<a name="12.0.3"></a>
11+
## [12.0.3](https://github.com/electron-userland/electron-builder/compare/v12.0.2...v12.0.3) (2017-01-29)
12+
13+
14+
### Features
15+
16+
* **nsis:** Pass --update flag to uninstaller when auto updating an application ([505a63d](https://github.com/electron-userland/electron-builder/commit/505a63d)), closes [#1162](https://github.com/electron-userland/electron-builder/issues/1162)
17+
18+
19+
20+
<a name="12.0.2"></a>
21+
## [12.0.2](https://github.com/electron-userland/electron-builder/compare/v12.0.1...v12.0.2) (2017-01-29)
22+
23+
24+
### Bug Fixes
25+
26+
* **deployment:** warn "A release is already published" instead of error ([5d64693](https://github.com/electron-userland/electron-builder/commit/5d64693)), closes [#1183](https://github.com/electron-userland/electron-builder/issues/1183)
27+
* **nsis:** add `+` as safe symbol for product name ([e7e2a82](https://github.com/electron-userland/electron-builder/commit/e7e2a82))
28+
* deepAssign error without config ([5d72c10](https://github.com/electron-userland/electron-builder/commit/5d72c10)), closes [#1177](https://github.com/electron-userland/electron-builder/issues/1177)
29+
30+
31+
### Features
32+
33+
* **electron-updater:** add requestHeaders option ([dd1320d](https://github.com/electron-userland/electron-builder/commit/dd1320d)), closes [#1175](https://github.com/electron-userland/electron-builder/issues/1175)
34+
35+
36+
37+
<a name="12.0.1"></a>
38+
## [12.0.1](https://github.com/electron-userland/electron-builder/compare/v12.0.0...v12.0.1) (2017-01-27)
39+
40+
41+
### Bug Fixes
42+
43+
* **deployment:** Error on CI build when GH_TOKEN not set for external PRs ([ee32575](https://github.com/electron-userland/electron-builder/commit/ee32575)), closes [#1178](https://github.com/electron-userland/electron-builder/issues/1178)
44+
45+
46+
47+
<a name="12.0.0"></a>
48+
# [12.0.0](https://github.com/electron-userland/electron-builder/compare/v11.7.0...v12.0.0) (2017-01-26)
49+
50+
51+
### Features
52+
53+
* **nsis:** use productName rather than name for install path if matches /^[-_0-9a-zA-Z ]+$/ ([2539cfb](https://github.com/electron-userland/electron-builder/commit/2539cfb)), closes [#1100](https://github.com/electron-userland/electron-builder/issues/1100) [#767](https://github.com/electron-userland/electron-builder/issues/767) [#1104](https://github.com/electron-userland/electron-builder/issues/1104)
54+
55+
56+
### BREAKING CHANGES
57+
58+
* nsis: installation path change
59+
60+
61+
62+
<a name="11.7.0"></a>
63+
# [11.7.0](https://github.com/electron-userland/electron-builder/compare/v11.6.1...v11.7.0) (2017-01-26)
64+
65+
66+
### Features
67+
68+
* **nsis:** Show welcome and finish page duing uninstall (#1173) ([aa43344](https://github.com/electron-userland/electron-builder/commit/aa43344))
69+
70+
71+
72+
<a name="11.6.1"></a>
73+
## [11.6.1](https://github.com/electron-userland/electron-builder/compare/v11.6.0...v11.6.1) (2017-01-25)
74+
75+
76+
### Bug Fixes
77+
78+
* Error during signing when running as Windows SYSTEM user ([688111e](https://github.com/electron-userland/electron-builder/commit/688111e)), closes [#1164](https://github.com/electron-userland/electron-builder/issues/1164)
79+
80+
81+
82+
<a name="11.6.0"></a>
83+
# [11.6.0](https://github.com/electron-userland/electron-builder/compare/v11.5.2...v11.6.0) (2017-01-25)
84+
85+
86+
### Features
87+
88+
* **electron-updater:** cannot use updater without administrator privileges ([7c2973d](https://github.com/electron-userland/electron-builder/commit/7c2973d)), closes [#1133](https://github.com/electron-userland/electron-builder/issues/1133)
89+
90+
91+
92+
<a name="11.5.2"></a>
93+
## [11.5.2](https://github.com/electron-userland/electron-builder/compare/v11.5.1...v11.5.2) (2017-01-24)
94+
95+
96+
### Bug Fixes
97+
98+
* **deployment:** another fix for "only first artifact is uploaded to GitHub" ([93b4d59](https://github.com/electron-userland/electron-builder/commit/93b4d59)), closes [#1133](https://github.com/electron-userland/electron-builder/issues/1133)
99+
* **nsis:** Must be error if file association is set, but perMachine not ([96c8ed9](https://github.com/electron-userland/electron-builder/commit/96c8ed9)), closes [#772](https://github.com/electron-userland/electron-builder/issues/772)
100+
101+
102+
103+
<a name="11.5.1"></a>
104+
## [11.5.1](https://github.com/electron-userland/electron-builder/compare/v11.5.0...v11.5.1) (2017-01-21)
105+
106+
107+
### Bug Fixes
108+
109+
* Arch & pacman use i686 instead of i386 and pkg.tar.xz (#1148) ([5fe94ee](https://github.com/electron-userland/electron-builder/commit/5fe94ee))
110+
111+
112+
### Features
113+
114+
* **deployment:** Only first artifact is uploaded to GitHub ([e3ab55b](https://github.com/electron-userland/electron-builder/commit/e3ab55b)), closes [#1133](https://github.com/electron-userland/electron-builder/issues/1133)
115+
* **electron-updater:** NSIS autoUpdater.setFeedURL throws error ([eb6a453](https://github.com/electron-userland/electron-builder/commit/eb6a453)), closes [#1105](https://github.com/electron-userland/electron-builder/issues/1105)
116+
117+
118+
119+
<a name="11.5.0"></a>
120+
# [11.5.0](https://github.com/electron-userland/electron-builder/compare/v11.4.4...v11.5.0) (2017-01-18)
121+
122+
123+
### Bug Fixes
124+
125+
* make file association name optional ([248855c](https://github.com/electron-userland/electron-builder/commit/248855c)), closes [#1069](https://github.com/electron-userland/electron-builder/issues/1069)
126+
127+
128+
### Features
129+
130+
* **electron-updater:** Port support for downloads, Protocol support for generic backend ([8d883f1](https://github.com/electron-userland/electron-builder/commit/8d883f1))
131+
132+
133+
134+
<a name="11.4.4"></a>
135+
## [11.4.4](https://github.com/electron-userland/electron-builder/compare/v11.4.3...v11.4.4) (2017-01-17)
136+
137+
138+
### Bug Fixes
139+
140+
* **publish:** resolve any publish configuration — not only string ([98c2c8e](https://github.com/electron-userland/electron-builder/commit/98c2c8e))
141+
142+
143+
144+
<a name="11.4.3"></a>
145+
## [11.4.3](https://github.com/electron-userland/electron-builder/compare/v11.4.1...v11.4.3) (2017-01-16)
146+
147+
148+
### Bug Fixes
149+
150+
* generate latest-mac.json for github in the github directory ([8670d5a](https://github.com/electron-userland/electron-builder/commit/8670d5a))
151+
* **snap:** interface 'platform' doesn't exist ([ade922c](https://github.com/electron-userland/electron-builder/commit/ade922c)), closes [#1123](https://github.com/electron-userland/electron-builder/issues/1123)
152+
153+
154+
155+
<a name="11.4.1"></a>
156+
## [11.4.1](https://github.com/electron-userland/electron-builder/compare/v11.4.0...v11.4.1) (2017-01-16)
157+
158+
159+
### Bug Fixes
160+
161+
* **AppImage:** include libappindicator1 in AppImage ([df7d316](https://github.com/electron-userland/electron-builder/commit/df7d316)), closes [#1082](https://github.com/electron-userland/electron-builder/issues/1082)
162+
163+
164+
165+
<a name="11.4.0"></a>
166+
# [11.4.0](https://github.com/electron-userland/electron-builder/compare/v11.3.0...v11.4.0) (2017-01-15)
167+
168+
169+
### Bug Fixes
170+
171+
* **squirrel.windows:** Crash after autoupdate downloads nuget package ([d10ba78](https://github.com/electron-userland/electron-builder/commit/d10ba78)), closes [#1101](https://github.com/electron-userland/electron-builder/issues/1101)
172+
173+
174+
### Features
175+
176+
* **electron-updater:** Electron Auto Updater MacOS support ([067d5c7](https://github.com/electron-userland/electron-builder/commit/067d5c7))
177+
* Separate build config from package.json ([ecfdc65](https://github.com/electron-userland/electron-builder/commit/ecfdc65)), closes [#1109](https://github.com/electron-userland/electron-builder/issues/1109)
178+
179+
180+
181+
<a name="11.3.0"></a>
182+
# [11.3.0](https://github.com/electron-userland/electron-builder/compare/v11.2.5...v11.3.0) (2017-01-14)
183+
184+
185+
### Bug Fixes
186+
187+
* **docker:** add missing libcurl3 for osslsigncode (#1116) ([f0a553a](https://github.com/electron-userland/electron-builder/commit/f0a553a))
188+
* **electron-updater:** Add better error handling for github releases (#1114) ([9dc5bc9](https://github.com/electron-userland/electron-builder/commit/9dc5bc9)), closes [#1112](https://github.com/electron-userland/electron-builder/issues/1112)
189+
190+
191+
192+
<a name="11.2.5"></a>
193+
## [11.2.5](https://github.com/electron-userland/electron-builder/compare/v11.2.4...v11.2.5) (2017-01-12)
194+
195+
196+
### Bug Fixes
197+
198+
* **codeSign:** signing with "Mac Developer" failed #1103 ([88682e8](https://github.com/electron-userland/electron-builder/commit/88682e8))
199+
200+
201+
202+
<a name="11.2.4"></a>
203+
## [11.2.4](https://github.com/electron-userland/electron-builder/compare/v11.2.1...v11.2.4) (2017-01-11)
204+
205+
206+
207+
<a name="11.2.1"></a>
208+
## [11.2.1](https://github.com/electron-userland/electron-builder/compare/v11.2.0...v11.2.1) (2017-01-09)
209+
210+
211+
### Bug Fixes
212+
213+
* do not fail if cannot rebuild optional dep ([f67b7d2](https://github.com/electron-userland/electron-builder/commit/f67b7d2)), closes [#1075](https://github.com/electron-userland/electron-builder/issues/1075)
214+
215+
216+
217+
<a name="11.2.0"></a>
218+
# [11.2.0](https://github.com/electron-userland/electron-builder/compare/v11.1.1...v11.2.0) (2017-01-08)
219+
220+
221+
### Bug Fixes
222+
223+
* **electron-auto-updater:** uncaught SHA2 checksum mismatch exception ([cb87588](https://github.com/electron-userland/electron-builder/commit/cb87588))
224+
225+
226+
### Features
227+
228+
* linked dirs outside of projects (e.g. linked modules) ([2364a1c](https://github.com/electron-userland/electron-builder/commit/2364a1c)), closes [#675](https://github.com/electron-userland/electron-builder/issues/675)
229+
230+
231+
232+
<a name="11.1.1"></a>
233+
## [11.1.1](https://github.com/electron-userland/electron-builder/compare/v1.1.1...v11.1.1) (2017-01-06)
234+
235+
236+
### Bug Fixes
237+
238+
* to preserve compatibility with old electron-auto-updater (< 0.10.0), we upload file with path specific for GitHub ([c06f3f4](https://github.com/electron-userland/electron-builder/commit/c06f3f4))
239+
240+
241+
242+
<a name="11.1.0"></a>
243+
# [11.1.0](https://github.com/electron-userland/electron-builder/compare/v11.0.0...v11.1.0) (2017-01-05)
244+
245+
246+
### Features
247+
248+
* **nsis:** Change installation directory when not using 'oneClick' with NSIS ([06b0103](https://github.com/electron-userland/electron-builder/commit/06b0103)), closes [#596](https://github.com/electron-userland/electron-builder/issues/596)
249+
250+
251+
252+
<a name="11.0.0"></a>
253+
# [11.0.0](https://github.com/electron-userland/electron-builder/compare/v10.17.2...v11.0.0) (2017-01-05)
254+
255+
256+
### Bug Fixes
257+
258+
* **electron-builder-http:** electron-auto-updater request can download so fast that the first few chunks arrive before ensureDirPromise has finished for configurePipes to run ([cb85790](https://github.com/electron-userland/electron-builder/commit/cb85790)), closes [#1081](https://github.com/electron-userland/electron-builder/issues/1081)
259+
* electron-builder not generating "latest.yml" file ([0f1fc4d](https://github.com/electron-userland/electron-builder/commit/0f1fc4d)), closes [#925](https://github.com/electron-userland/electron-builder/issues/925)
260+
261+
262+
### Code Refactoring
263+
264+
* extract electron-builder-squirrel-windows ([6256432](https://github.com/electron-userland/electron-builder/commit/6256432))
265+
266+
267+
### Features
268+
269+
* add beforeBuild callback (#1085) ([35a8cdf](https://github.com/electron-userland/electron-builder/commit/35a8cdf)), closes [#982](https://github.com/electron-userland/electron-builder/issues/982)
270+
271+
272+
### BREAKING CHANGES
273+
274+
* To use Squirrel.Windows please install `electron-builder-squirrel-windows` dependency.
275+
276+
277+
278+
<a name="10.17.2"></a>
279+
## [10.17.2](https://github.com/electron-userland/electron-builder/compare/v10.17.0...v10.17.2) (2017-01-04)
280+
281+
282+
### Bug Fixes
283+
284+
* Unhandled rejection SyntaxError: Unexpected token ... ([0c81bf7](https://github.com/electron-userland/electron-builder/commit/0c81bf7)), closes [#1076](https://github.com/electron-userland/electron-builder/issues/1076)
285+
* use transformer to notify about progress ([7fa56bc](https://github.com/electron-userland/electron-builder/commit/7fa56bc)), closes [#1077](https://github.com/electron-userland/electron-builder/issues/1077)
286+
* **dmg:** Can't locate Mac/Finder/DSStore.pm in [@INC](https://github.com/INC) ([8d0e230](https://github.com/electron-userland/electron-builder/commit/8d0e230)), closes [#1079](https://github.com/electron-userland/electron-builder/issues/1079)
287+
288+
289+
290+
<a name="10.17.0"></a>
291+
# [10.17.0](https://github.com/electron-userland/electron-builder/compare/v10.16.0...v10.17.0) (2017-01-03)
292+
293+
294+
### Bug Fixes
295+
296+
* asarUnpack unpacks parent directory when file is specified ([82f16d1](https://github.com/electron-userland/electron-builder/commit/82f16d1)), closes [#1071](https://github.com/electron-userland/electron-builder/issues/1071)
297+
298+
299+
### Features
300+
301+
* **linux:** use ${macro} syntax for linux templates ([fe137fc](https://github.com/electron-userland/electron-builder/commit/fe137fc))
302+
303+
304+
305+
<a name="10.16.0"></a>
306+
# [10.16.0](https://github.com/electron-userland/electron-builder/compare/v10.15.2...v10.16.0) (2017-01-02)
307+
308+
309+
### Features
310+
311+
* **nsis:** allow submenu in start menu in programfiles ([e3faaf1](https://github.com/electron-userland/electron-builder/commit/e3faaf1)), closes [#1063](https://github.com/electron-userland/electron-builder/issues/1063)
312+
313+
314+
5315
<a name="10.15.2"></a>
6-
# [0.15.2](https://github.com/electron-userland/electron-builder/compare/v10.15.1...v0.0.0-semantic-release) (2016-12-31)
316+
## [10.15.2](https://github.com/electron-userland/electron-builder/compare/v10.15.1...v10.15.2) (2016-12-31)
7317

8318

9319
### Bug Fixes
10320

11-
* **dmg:** Unable to build with custom path ([89f7f6a](https://github.com/electron-userland/electron-builder/commit/89f7f6a)), closes [#847](https://github.com/electron-userland/electron-builder/issues/847) [#1054](https://github.com/electron-userland/electron-builder/issues/1054)
321+
* **dmg:** Unable to build with custom path ([3bf8c93](https://github.com/electron-userland/electron-builder/commit/3bf8c93)), closes [#847](https://github.com/electron-userland/electron-builder/issues/847) [#1054](https://github.com/electron-userland/electron-builder/issues/1054)
12322
* **docker:** Docker - wine - bad exe format for rcedit.exe ([920c230](https://github.com/electron-userland/electron-builder/commit/920c230))
13323
* **electron-auto-updater:** Checking for updates from github was failing ([3401630](https://github.com/electron-userland/electron-builder/commit/3401630)), closes [#1038](https://github.com/electron-userland/electron-builder/issues/1038)
14324

@@ -2937,4 +3247,4 @@ Auto-update — please see https://github.com/electron-userland/electron-builder
29373247

29383248
### Features
29393249

2940-
* use read-package-json as a correct fix of Linux maintainer .deb package field ([3fba451](https://github.com/electron-userland/electron-builder/commit/3fba451))
3250+
* use read-package-json as a correct fix of Linux maintainer .deb package field ([3fba451](https://github.com/electron-userland/electron-builder/commit/3fba451))

packages/electron-builder/src/fileMatcher.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ export class FileMatcher {
2424
constructor(from: string, to: string, private options: FileMatchOptions, patterns?: Array<string> | string | n) {
2525
this.from = this.expandPattern(from)
2626
this.to = this.expandPattern(to)
27-
this.patterns = asArray(patterns)
27+
this.patterns = asArray(patterns).map(it => path.posix.normalize(it))
2828
}
2929

3030
addPattern(pattern: string) {
31-
this.patterns.push(pattern)
31+
this.patterns.push(path.posix.normalize((pattern)))
3232
}
3333

3434
addAllPattern() {

packages/electron-builder/src/platformPackager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,9 @@ export abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions>
306306
patterns = [patterns]
307307
}
308308

309-
for (let i = 0; i < patterns.length; i++) {
310-
const pattern = patterns[i]
309+
for (const pattern of patterns) {
311310
if (typeof pattern === "string") {
311+
// use normalize to transform ./foo to foo
312312
defaultMatcher.addPattern(pattern)
313313
}
314314
else if (allowAdvancedMatching) {
@@ -326,7 +326,7 @@ export abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions>
326326
addPatterns(platformSpecificPatterns)
327327

328328
if (!defaultMatcher.isEmpty()) {
329-
// Default matcher should be first in the array
329+
// default matcher should be first in the array
330330
fileMatchers.unshift(defaultMatcher)
331331
}
332332

test/src/filesTest.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ test.ifNotCiWin("extraResources", async () => {
4444
extraResources: [
4545
"foo",
4646
"bar/hello.txt",
47+
"./dir-relative/f.txt",
4748
"bar/${arch}.txt",
4849
"${os}/${arch}.txt",
4950
],
@@ -61,6 +62,7 @@ test.ifNotCiWin("extraResources", async () => {
6162
return BluebirdPromise.all([
6263
outputFile(path.join(projectDir, "foo/nameWithoutDot"), "nameWithoutDot"),
6364
outputFile(path.join(projectDir, "bar/hello.txt"), "data"),
65+
outputFile(path.join(projectDir, "dir-relative/f.txt"), "data"),
6466
outputFile(path.join(projectDir, `bar/${process.arch}.txt`), "data"),
6567
outputFile(path.join(projectDir, `${osName}/${process.arch}.txt`), "data"),
6668
outputFile(path.join(projectDir, "platformSpecificR"), "platformSpecificR"),
@@ -78,6 +80,7 @@ test.ifNotCiWin("extraResources", async () => {
7880
assertThat(path.join(resourcesDir, "foo")).isDirectory(),
7981
assertThat(path.join(resourcesDir, "foo", "nameWithoutDot")).isFile(),
8082
assertThat(path.join(resourcesDir, "bar", "hello.txt")).isFile(),
83+
assertThat(path.join(resourcesDir, "dir-relative", "f.txt")).isFile(),
8184
assertThat(path.join(resourcesDir, "bar", `${process.arch}.txt`)).isFile(),
8285
assertThat(path.join(resourcesDir, osName, `${process.arch}.txt`)).isFile(),
8386
assertThat(path.join(resourcesDir, "platformSpecificR")).isFile(),
@@ -86,6 +89,7 @@ test.ifNotCiWin("extraResources", async () => {
8689
},
8790
expectedContents: platform === Platform.WINDOWS ? pathSorter(expectedWinContents.concat(
8891
winDirPrefix + "bar/hello.txt",
92+
winDirPrefix + "dir-relative/f.txt",
8993
winDirPrefix + "bar/x64.txt",
9094
winDirPrefix + "foo/nameWithoutDot",
9195
winDirPrefix + "platformSpecificR",

0 commit comments

Comments
 (0)