Kaleabe Negussie
Kaleabe Negussie

Reputation: 1

Setting up husky pre commit for sub folders of repository folder in flutter

There is a repository with several projects and two of them are mobile apps with flutter and I want to add husky pre-commit to them. And on the pre-commits I want to check flutter analyze and dart format. The structure of the repo is

repo
  |-.git
  |-app1
  |-app2

I tried to install husky by following the documentation.

After adding husky to the pub the documentation says that you have to run dart run husky install this command and if you want different folder structures on the custom folders section it says that you can achieve this by using the command dart run husky install sub/.husky but after running this command I am getting no pubspec.yaml found. And when you run the command dart run husky install from with in the mobile folder I am getting husky - Exception: .git can't be found. error. On other answers and posts for node projects you can add cd to the scripts but I am not sure how to do this for flutter.

Upvotes: 0

Views: 36

Answers (0)

Related Questions