Skip to content

Commit a02fbd7

Browse files
committed
fix(AppImage): AppImage artifact name does not use artifactName template
Close #1726
1 parent 6f8b94b commit a02fbd7

File tree

7 files changed

+18
-8
lines changed

7 files changed

+18
-8
lines changed

docs/Options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ Configuration Options
374374

375375
If list contains `default`, it will be replaced to default list, so, `["default", "foo"]` can be used to add custom parts `foo` in addition to defaults.
376376
* <a name="SnapOptions-ubuntuAppPlatformContent"></a>`ubuntuAppPlatformContent` String - Specify `ubuntu-app-platform1` to use [ubuntu-app-platform](https://insights.ubuntu.com/2016/11/17/how-to-create-snap-packages-on-qt-applications/). Snap size will be greatly reduced, but it is not recommended for now because "the snaps must be connected before running uitk-gallery for the first time".
377-
* <a name="Config-appimage"></a>`appimage` [LinuxTargetSpecificOptions](electron-builder#LinuxTargetSpecificOptions)
377+
* <a name="Config-appImage"></a>`appImage` [LinuxTargetSpecificOptions](electron-builder#LinuxTargetSpecificOptions)
378378
* <a name="Config-pacman"></a>`pacman` [LinuxTargetSpecificOptions](electron-builder#LinuxTargetSpecificOptions)
379379
* <a name="Config-rpm"></a>`rpm` [LinuxTargetSpecificOptions](electron-builder#LinuxTargetSpecificOptions)
380380
* <a name="Config-freebsd"></a>`freebsd` [LinuxTargetSpecificOptions](electron-builder#LinuxTargetSpecificOptions)

docs/api/electron-builder.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767

6868
| Name | Type |
6969
| --- | --- |
70+
| **outDir**| <code>String</code> |
7071
| **appOutDir**| <code>String</code> |
7172
| **packager**| <code>[PlatformPackager](#PlatformPackager)&lt;any&gt;</code> |
7273
| **electronPlatformName**| <code>String</code> |
@@ -106,7 +107,6 @@
106107
| **repositoryInfo**| <code>Promise&lt; \| [SourceRepositoryInfo](#SourceRepositoryInfo)&gt;</code> |
107108
| **isPrepackedAppAsar**| <code>Boolean</code> |
108109
| **cancellationToken**| <code>[CancellationToken](electron-builder-http#CancellationToken)</code> |
109-
| **outDir**| <code>String</code> |
110110

111111

112112
* [`.BuildInfo`](#BuildInfo)
@@ -224,7 +224,6 @@
224224
| tempDirManager = <code>new TmpDir()</code>| <code>module:electron-builder-util/out/tmp.TmpDir</code> |
225225
| options| <code>[PackagerOptions](Options#PackagerOptions)</code> |
226226
| **repositoryInfo**| <code>Promise&lt; \| [SourceRepositoryInfo](#SourceRepositoryInfo)&gt;</code> |
227-
| **outDir**| <code>String</code> |
228227

229228

230229
* [.Packager](#Packager) ⇐ <code>[BuildInfo](#BuildInfo)</code>
@@ -793,9 +792,13 @@
793792
## electron-builder/out/util/flags
794793

795794
* [electron-builder/out/util/flags](#module_electron-builder/out/util/flags)
795+
* [`.isBuildCacheEnabled()`](#module_electron-builder/out/util/flags.isBuildCacheEnabled) ⇒ <code>Boolean</code>
796796
* [`.isUseSystemSigncode()`](#module_electron-builder/out/util/flags.isUseSystemSigncode) ⇒ <code>Boolean</code>
797797
* [`.isUseSystemWine()`](#module_electron-builder/out/util/flags.isUseSystemWine) ⇒ <code>Boolean</code>
798798

799+
<a name="module_electron-builder/out/util/flags.isBuildCacheEnabled"></a>
800+
### `electron-builder/out/util/flags.isBuildCacheEnabled()` ⇒ <code>Boolean</code>
801+
**Kind**: method of [<code>electron-builder/out/util/flags</code>](#module_electron-builder/out/util/flags)
799802
<a name="module_electron-builder/out/util/flags.isUseSystemSigncode"></a>
800803
### `electron-builder/out/util/flags.isUseSystemSigncode()` ⇒ <code>Boolean</code>
801804
**Kind**: method of [<code>electron-builder/out/util/flags</code>](#module_electron-builder/out/util/flags)

packages/electron-builder/src/metadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ export interface Config extends PlatformSpecificBuildOptions {
298298
* [Snap](http://snapcraft.io) options.
299299
*/
300300
readonly snap?: SnapOptions | null
301-
readonly appimage?: LinuxTargetSpecificOptions | null
301+
readonly appImage?: LinuxTargetSpecificOptions | null
302302
readonly pacman?: LinuxTargetSpecificOptions | null
303303
readonly rpm?: LinuxTargetSpecificOptions | null
304304
readonly freebsd?: LinuxTargetSpecificOptions | null

packages/electron-builder/src/targets/appImage.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export default class AppImageTarget extends Target {
3535
const packager = this.packager
3636

3737
// https://github.com/electron-userland/electron-builder/issues/775
38-
const resultFile = path.join(this.outDir, packager.computeSafeArtifactName("AppImage", arch, false))
38+
// https://github.com/electron-userland/electron-builder/issues/1726
39+
const resultFile = path.join(this.outDir, this.options.artifactName == null ? packager.computeSafeArtifactName("AppImage", arch, false) : packager.expandArtifactNamePattern(this.options, "AppImage", arch))
3940
await unlinkIfExists(resultFile)
4041

4142
const appImagePath = await appImagePathPromise
@@ -98,6 +99,6 @@ export default class AppImageTarget extends Target {
9899

99100
await chmod(resultFile, "0755")
100101

101-
packager.dispatchArtifactCreated(resultFile, this, arch)
102+
packager.dispatchArtifactCreated(resultFile, this, arch, packager.computeSafeArtifactName("AppImage", arch, false))
102103
}
103104
}

packages/electron-builder/src/targets/pkg.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class PkgTarget extends Target {
5858
})
5959
await BluebirdPromise.all([unlink(innerPackageFile), unlink(distInfoFile)])
6060

61-
packager.dispatchArtifactCreated(outFile, this, arch, `${appInfo.name}-${appInfo.version}.pkg`)
61+
packager.dispatchArtifactCreated(outFile, this, arch, packager.computeSafeArtifactName("pkg", arch))
6262
}
6363

6464
private async customizeDistributionConfiguration(distInfoFile: string, appPath: string) {

test/out/linux/__snapshots__/linuxPackagerTest.js.snap

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ Object {
1818
"linux": Array [
1919
Object {
2020
"arch": 1,
21-
"file": "TestApp-1.1.0-x86_64.AppImage",
21+
"file": "boo-Test App ßW",
22+
"safeArtifactName": "TestApp-1.1.0-x86_64.AppImage",
2223
},
2324
],
2425
}
@@ -30,6 +31,7 @@ Object {
3031
Object {
3132
"arch": 1,
3233
"file": "TestApp-1.1.0-x86_64.AppImage",
34+
"safeArtifactName": "TestApp-1.1.0-x86_64.AppImage",
3335
},
3436
],
3537
}
@@ -41,6 +43,7 @@ Object {
4143
Object {
4244
"arch": 1,
4345
"file": "TestApp-1.1.0-x86_64.AppImage",
46+
"safeArtifactName": "TestApp-1.1.0-x86_64.AppImage",
4447
},
4548
],
4649
}

test/src/linux/linuxPackagerTest.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ test.ifDevOrLinuxCi("AppImage - default icon, custom executable and custom deskt
1616
Foo: "bar",
1717
Terminal: "true",
1818
},
19+
},
20+
appImage: {
21+
artifactName: "boo-${productName}",
1922
}
2023
},
2124
effectiveOptionComputed: async (it) => {

0 commit comments

Comments
 (0)