import * as ChildProcess from 'child_process'
import * as Path from 'path'

const args = process.argv.slice(2)

// At some point we may have other command line options, but for now we assume
// the first arg is the path to open.
const pathArg = args.length > 0 ? args[0] : ''
const repositoryPath = Path.resolve(process.cwd(), pathArg)
const url = `x-github-client://openLocalRepo/${encodeURIComponent(repositoryPath)}`

const command = __DARWIN__ ? 'open' : 'start'
ChildProcess.exec(`${command} ${url}`)

process.exit(0)

console.log('hi everyone')

Revert "Invoke the URL protocol"
Revert "Invoke the URL protocol"

This reverts commit 4e9980224093f6e1b14d03b889da2d16278f533f.
