Skip to content

Instantly share code, notes, and snippets.

@anhkind
Last active January 22, 2024 07:18
Show Gist options
  • Select an option

  • Save anhkind/4f19428ab1dc00c98ff67f1a7c45cdda to your computer and use it in GitHub Desktop.

Select an option

Save anhkind/4f19428ab1dc00c98ff67f1a7c45cdda to your computer and use it in GitHub Desktop.

Revisions

  1. anhkind revised this gist Jan 22, 2024. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions .profile
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # from: https://github.com/microsoft/WSL/issues/4401#issuecomment-670080585

    # checks to see if we are in a windows or linux dir
    function isWinDir {
    case $PWD/ in
  2. anhkind created this gist Jan 22, 2024.
    16 changes: 16 additions & 0 deletions .profile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    # checks to see if we are in a windows or linux dir
    function isWinDir {
    case $PWD/ in
    /mnt/*) return $(true);;
    *) return $(false);;
    esac
    }
    # wrap the git command to either run windows git or linux
    function git {
    if isWinDir
    then
    git.exe "$@"
    else
    /usr/bin/git "$@"
    fi
    }