UNPKG

@dx-box/common

Version:

(DX) by providing common configurations for TypeScript, ESLint, Prettier, and automated Git hooks for formatting and linting.

2 lines (1 loc) 590 B
import{execSync as i}from"child_process";import s from"readline";const m=async()=>{const e=await n("\u{1F310} Please enter the Git remote URL (e.g., https://github.com/your-org/your-repo.git): ");try{i(`git remote add origin ${e}`,{stdio:"inherit"}),console.log(`\u2705 Git origin has been set: ${e}`)}catch{console.error("\u274C Failed to set origin. It may already exist or the URL may be invalid.")}return e},n=e=>{const t=s.createInterface({input:process.stdin,output:process.stdout});return new Promise(r=>{t.question(e,o=>{t.close(),r(o.trim())})})};export{m as askUserForGitRemote};