-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
39f98b3
commit 334c086
Showing
10 changed files
with
69 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ name: ci | |
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
branches: ["*"] | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @ayushmanchhabra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var argv = require('yargs').argv; | ||
import { readFileSync, writeFileSync } from 'fs'; | ||
import { join, basename } from 'path'; | ||
import { argv } from 'yargs'; | ||
|
||
// Helper to simulate the shell's "cp" command | ||
function copyFileSync(srcFile, destFile) { | ||
var content = fs.readFileSync(srcFile); | ||
fs.writeFileSync(destFile, content); | ||
var content = readFileSync(srcFile); | ||
writeFileSync(destFile, content); | ||
} | ||
|
||
// Copy asset files (specified via process.argv) over to the app binary's folder | ||
exports.copyAssets = function copyAssets(platform, binPath) { | ||
export function copyAssets(platform, binPath) { | ||
// OS X: Save a custom plist file to Contents/Info.plist in the | ||
// app bundle. This lets you customize things like the app's menubar | ||
// name and icon (see argv.mac_icon below) | ||
if (argv.mac_plist && platform === 'darwin') { | ||
var plistPath = path.join(binPath, '..', '..', 'Info.plist'); | ||
var plistPath = join(binPath, '..', '..', 'Info.plist'); | ||
copyFileSync(argv.mac_plist, plistPath); | ||
} | ||
|
||
// OS X: Save icon files to the Resources dir in the app bundle. | ||
// Note that for the icon to work properly you need to point to | ||
// it with a custom plist file. | ||
if (argv.mac_icon && platform === 'darwin') { | ||
var iconName = path.basename(argv.mac_icon); // Preserve the file's name | ||
var iconPath = path.join(binPath, '..', '..', 'Resources', iconName); | ||
var iconName = basename(argv.mac_icon); // Preserve the file's name | ||
var iconPath = join(binPath, '..', '..', 'Resources', iconName); | ||
copyFileSync(argv.mac_icon, iconPath); | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"name": "nwapp", | ||
"name": "demo", | ||
"main": "index.html" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
const { strictEqual } = require('node:assert'); | ||
const { existsSync } = require('node:fs'); | ||
const test = require('node:test'); | ||
import assert from 'node:assert'; | ||
import fs from 'node:fs'; | ||
import test from 'node:test'; | ||
|
||
const findpath = require('../lib/findpath.js').findpath; | ||
import { findpath } from '../lib/findpath.js'; | ||
|
||
test('nwjs has downloaded and been extracted', function() { | ||
strictEqual(existsSync(findpath()), true); | ||
assert.strictEqual(fs.existsSync(findpath()), true); | ||
}); | ||
|
||
test('chromedriver does not exist in normal build', function() { | ||
strictEqual(existsSync(findpath('chromedriver')), false); | ||
assert.strictEqual(fs.existsSync(findpath('chromedriver')), false); | ||
}); |