Skip to content

Commit

Permalink
Random testing
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhabib committed Aug 19, 2024
1 parent 4a853e5 commit de386a3
Showing 1 changed file with 14 additions and 28 deletions.
42 changes: 14 additions & 28 deletions packages/sku/lib/openBrowser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,20 @@ module.exports = (url) => {
console.log('useEdge: ', useEdge);

if (process.platform === 'darwin') {
if (useChrome) {
try {
// Try our best to reuse existing tab
// on OS X Google Chrome with AppleScript
execSync('ps cax | grep "Google Chrome"');
execSync(`osascript openChrome.applescript "${encodeURI(url)}"`, {
cwd: __dirname,
stdio: 'ignore',
});
return;
} catch (e) {
// Ignore errors.
}
}
if (useEdge) {
try {
// Try our best to reuse existing tab
// on OS X Google Chrome with AppleScript
execSync('ps cax | grep "Microsoft Edge"');
execSync(`osascript openEdge.applescript "${encodeURI(url)}"`, {
cwd: __dirname,
stdio: 'ignore',
});
return;
} catch (e) {
console.log('erroring here');
// Ignore errors.
}
console.log('in here');

try {
// Try our best to reuse existing tab
// on OS X Google Chrome with AppleScript
execSync('ps cax | grep "Microsoft Edge"');
execSync(`osascript openEdge.applescript "${encodeURI(url)}"`, {
cwd: __dirname,
stdio: 'ignore',
});
return;
} catch (e) {
console.log('erroring here');
// Ignore errors.
}
}

Expand Down

0 comments on commit de386a3

Please sign in to comment.