mirror of
https://github.com/ershisan99/create-react-component.git
synced 2025-12-17 12:33:07 +00:00
add currentDir to pnpm execution
This commit is contained in:
7
main.go
7
main.go
@@ -106,8 +106,8 @@ export const Default: Story = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Execute formatting and linting commands
|
// Execute formatting and linting commands
|
||||||
runCommand("pnpm", "run", "format:file", dirPath)
|
runCommand(currentDir, "pnpm", "run", "format:file", dirPath)
|
||||||
runCommand("pnpm", "run", "lint:file", dirPath+"/**")
|
runCommand(currentDir, "pnpm", "run", "lint:file", dirPath+"/**")
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -149,8 +149,9 @@ func updateMainIndex(name, currentDir string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func runCommand(command string, args ...string) {
|
func runCommand(currentDir, command string, args ...string) {
|
||||||
cmd := exec.Command(command, args...)
|
cmd := exec.Command(command, args...)
|
||||||
|
cmd.Dir = currentDir // Set the working directory
|
||||||
output, err := cmd.CombinedOutput()
|
output, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Error executing command:", err)
|
fmt.Println("Error executing command:", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user