smartopen/ts/index.ts

14 lines
280 B
TypeScript
Raw Normal View History

2019-06-04 09:25:51 +00:00
import open from 'opn';
import { ChildProcess } from 'child_process';
2017-03-12 20:20:43 +00:00
export let openUrl = async urlArg => {
2019-04-16 06:26:16 +00:00
if (!(process.env.CI === 'true')) {
const childProcess = await open(urlArg, {
wait: false
});
return childProcess;
} else {
2019-04-16 06:26:16 +00:00
return null;
}
};