<commit_before>import * as Path from 'path'

import { ICommandModule, mriArgv } from '../load-commands'
import { openDesktop } from '../open-desktop'

interface IOpenArgs extends mriArgv {
  readonly path: string
}

const command: ICommandModule = {
  command: 'open <path>',
  aliases: ['<path>'],
  description: 'Open a git repository in GitHub Desktop',
  args: [
    {
      name: 'path',
      description: 'The path to the repository to open',
      type: 'string',
      required: false,
    },
  ],
  handler({ _: [pathArg] }: IOpenArgs) {
    if (!pathArg) {
      // just open Desktop
      openDesktop()
      return
    }
    const repositoryPath = Path.resolve(process.cwd(), pathArg)
    const url = `openLocalRepo/${encodeURIComponent(repositoryPath)}`
    openDesktop(url)
  },
}
export = command<commit_msg>provide the protocol when opening<commit_after>import * as Path from 'path'

import { ICommandModule, mriArgv } from '../load-commands'
import { openDesktop } from '../open-desktop'

interface IOpenArgs extends mriArgv {
  readonly path: string
}

const command: ICommandModule = {
  command: 'open <path>',
  aliases: ['<path>'],
  description: 'Open a git repository in GitHub Desktop',
  args: [
    {
      name: 'path',
      description: 'The path to the repository to open',
      type: 'string',
      required: false,
    },
  ],
  handler({ _: [pathArg] }: IOpenArgs) {
    if (!pathArg) {
      // just open Desktop
      openDesktop()
      return
    }
    const repositoryPath = Path.resolve(process.cwd(), pathArg)
    const url = `x-github-client://openLocalRepo/${encodeURIComponent(
      repositoryPath
    )}`
    openDesktop(url)
  },
}
export = command
{'fraction_non_alphanumeric': 0.13133097762073026, 'fraction_numerical': 0.0, 'mean_word_length': 3.093975903614458, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3922735', 'n_tokens_mistral': 530, 'n_tokens_neox': 524, 'n_words': 148}