mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-12-23 10:38:55 +00:00
Support Mac App Store (--mas) builds (PR #532)
This commit is contained in:
parent
cec9c4b819
commit
e1909bf5c8
@ -93,7 +93,7 @@ The name of the application, which will affect strings in titles and the icon.
|
|||||||
```
|
```
|
||||||
-p, --platform <value>
|
-p, --platform <value>
|
||||||
```
|
```
|
||||||
Automatically determined based on the current OS. Can be overwritten by specifying either `linux`, `windows`, or `osx`.
|
Automatically determined based on the current OS. Can be overwritten by specifying either `linux`, `windows`, `osx` or `mas` for a Mac App Store specific build.
|
||||||
|
|
||||||
The alternative values `win32` (for Windows) or `darwin`, `mac` (for OSX) can also be used.
|
The alternative values `win32` (for Windows) or `darwin`, `mac` (for OSX) can also be used.
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ function maybeCopyIcons(options, appPath, callback) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.platform === 'darwin') {
|
if (options.platform === 'darwin' || options.platform === 'mas') {
|
||||||
callback();
|
callback();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ if (require.main === module) {
|
|||||||
program.out = appDir;
|
program.out = appDir;
|
||||||
})
|
})
|
||||||
.option('-n, --name <value>', 'app name')
|
.option('-n, --name <value>', 'app name')
|
||||||
.option('-p, --platform <value>', '\'osx\', \'linux\' or \'windows\'')
|
.option('-p, --platform <value>', '\'osx\', \'mas\', \'linux\' or \'windows\'')
|
||||||
.option('-a, --arch <value>', '\'ia32\' or \'x64\' or \'armv7l\'')
|
.option('-a, --arch <value>', '\'ia32\' or \'x64\' or \'armv7l\'')
|
||||||
.option('--app-version <value>', 'The release version of the application. Maps to the `ProductVersion` metadata property on Windows, and `CFBundleShortVersionString` on OS X.')
|
.option('--app-version <value>', 'The release version of the application. Maps to the `ProductVersion` metadata property on Windows, and `CFBundleShortVersionString` on OS X.')
|
||||||
.option('--build-version <value>', 'The build version of the application. Maps to the `FileVersion` metadata property on Windows, and `CFBundleVersion` on OS X.')
|
.option('--build-version <value>', 'The build version of the application. Maps to the `FileVersion` metadata property on Windows, and `CFBundleVersion` on OS X.')
|
||||||
|
@ -2,7 +2,7 @@ import os from 'os';
|
|||||||
|
|
||||||
function inferPlatform() {
|
function inferPlatform() {
|
||||||
const platform = os.platform();
|
const platform = os.platform();
|
||||||
if (platform === 'darwin' || platform === 'win32' || platform === 'linux') {
|
if ((platform === 'darwin' || platform === 'mas') || platform === 'win32' || platform === 'linux') {
|
||||||
return platform;
|
return platform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ export function getUserAgentString(chromeVersion, platform) {
|
|||||||
let userAgent;
|
let userAgent;
|
||||||
switch (platform) {
|
switch (platform) {
|
||||||
case 'darwin':
|
case 'darwin':
|
||||||
|
case 'mas':
|
||||||
userAgent = `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${chromeVersion} Safari/537.36`;
|
userAgent = `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${chromeVersion} Safari/537.36`;
|
||||||
break;
|
break;
|
||||||
case 'win32':
|
case 'win32':
|
||||||
|
@ -6,6 +6,7 @@ const { assert } = chai;
|
|||||||
|
|
||||||
const TEST_RESULT = {
|
const TEST_RESULT = {
|
||||||
darwin: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36',
|
darwin: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36',
|
||||||
|
mas: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36',
|
||||||
win32: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36',
|
win32: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36',
|
||||||
linux: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36',
|
linux: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36',
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user