Sitecore / Sitecore.Pathfinder

Get started, get far, get happy!
Other
34 stars 12 forks source link

scc.cmd will not work for multiple developers #44

Closed JakobChristensen closed 8 years ago

JakobChristensen commented 8 years ago

When setting up a new project I understand why you create the scc.cmd file in the root of the project. However, this script points to the location of the executable that was used to setup the project. The path to this executable can and will be different from machine to machine. If the first developer checked the file into source control, others would not be able to use it. Instead, I think we should assume scc.exe is on the path. Distributing Pathfinder via chocolatey should help with that. This is the way I use NuGet which in many ways is quite similar to Pathfinder. When installing Pathfinder through NuGet and having the tool local to the project, then having the scc.cmd file would not be an issue, as long as it’s using a relative path to the executable.

JakobChristensen commented 8 years ago

Proposed fix: Let scc.cmd search for the appropriate scc.exe.

Search priority:

  1. /node_modules/sitecore-pathfinder/scc.exe
  2. /sitecore.tools/scc.exe
  3. [Path]/scc.exe
JakobChristensen commented 8 years ago

Fixed. scc.cmd now looks like this:

@echo off
setlocal

set "scc_exe=scc.exe"

if exist "%~dp0\sitecore.tools\scc.exe" (
    set "scc_exe=%~dp0\sitecore.tools\scc.exe"
)

if exist "%~dp0\node_modules\sitecore-pathfinder\scc.exe" (
    set "scc_exe=%~dp0\node_modules\sitecore-pathfinder\scc.exe"
)

"%scc_exe%" %*