1import { execSync } from 'child_process'3export const getTarCmd = () => {4 if (process.platform === 'darwin') {5 try {6 const gtarPath = execSync('which gtar', {encoding: 'utf8'}).trim()7 return gtarPath8 } catch {9 throw new Error(10 'GNU tar (gtar) not found on macOS. Install via Homebrew:\n' +11 ' brew install gnu-tar\n' +12 'GNU tar is required for --transform option used in docker builds.'13 )14 }15 }16 return 'tar'17}