Uploaded image for project: 'Sourcetree for Windows'
  1. Sourcetree for Windows
  2. SRCTREEWIN-8307

SourceTree does not honor command line parameters in Windows correctly

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: High High
    • None
    • 2.4.7.0
    • General
    • Windows 10, from PowerShell, opened per command line

    • Severity 2 - Major

      I want to open SourceTree per command line in the current repository.

      If I run $env:LOCALAPPDATA\SourceTree\SourceTree.exe -f . status then SourceTree opens, but not in the current repository.

      If I run $env:LOCALAPPDATA\SourceTree\app-2.4.7\SourceTree.exe -f . status then SourceTree opens correctly with the current repository.

      Since this is a Squirrel app, it is not feasible to use the hard path with the version. The Sourcetree start wrapper should route all command line parameters to the actual exe.

            [SRCTREEWIN-8307] SourceTree does not honor command line parameters in Windows correctly

            I just found a workaround.

            It seems, that relative paths are not working (the . especially) because the squirrel wrapper and the updater.exe seem to redirect the current directory to the installation dir.

            got it working with

            Start-Process $env:LOCALAPPDATA\SourceTree\SourceTree.exe "-f $PWD"
            

            as $PWD returns the absolute path of the current directory

            Deleted Account (Inactive) added a comment - I just found a workaround. It seems, that relative paths are not working (the . especially) because the squirrel wrapper and the updater.exe seem to redirect the current directory to the installation dir. got it working with Start- Process $env:LOCALAPPDATA\SourceTree\SourceTree.exe "-f $PWD" as $PWD returns the absolute path of the current directory

              Unassigned Unassigned
              c2ef9569-33fc-42cb-8551-eb6be7cc4b81 Deleted Account (Inactive)
              Affected customers:
              0 This affects my team
              Watchers:
              2 Start watching this issue

                Created:
                Updated: