scriptDir is defined in the calling script