Skip to content

Error: stat /dev/null/pre-push: not a directory 32.06  ELIFECYCLE  Command failed with exit code 1. #669

@xuelichao

Description

@xuelichao

🔧 Summary

This error happens when execute 'lefthook install' command in a docker build command with a react UI project.(in CICD ENV)

However, we can not encounter the same error in local PC when manually build an image with docker command.

The command pre-push is located at .git/command not the location '/dev/null/pre-push'

It seems that the method to get the command(pre-push) location(dir) is not correct in some conditions.

Lefthook version 1.5.0/1.6.5

Steps to reproduce

docker build --no-cache --network=host --pull --build-arg GOPROXY= --build-arg VERSION= --build-arg GIT_COMMIT= -t -f ./Dockerfile.test .

Dockerfile.test:
RUN pnpm i

package.json:
"prepare": "lefthook install",

Expected results

The command 'RUN pnpm i ' should be executed successfully and image should be built successfullly.

Actual results

Error: stat /dev/null/pre-push: not a directory 32.06  ELIFECYCLE  Command failed with exit code 1.

Possible Solution

Logs / Screenshots

LEFTHOOK_VERBOSE=true git ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions