git_hooks 0.0.2 copy "git_hooks: ^0.0.2" to clipboard
git_hooks: ^0.0.2 copied to clipboard

outdated

Prevents bad commit or push (git hooks, pre-commit/precommit, pre-push/prepush, post-merge/postmerge and all that stuff...).

example/git_hooks.dart

import "package:git_hooks/git_hooks.dart";
import "dart:io";

void main(List arguments) {
  Map<Git, UserBackFun> params = {
    Git.commitMsg: commitMsg,
    Git.preCommit: preCommit
  };
  change(arguments, params);
}

Future<bool> commitMsg() async {
  Directory rootDir = Directory.current;
  File myFile = new File(rootDir.path + "/.git/COMMIT_EDITMSG");
  print("commit message is '${myFile.readAsStringSync()}'");
  print('this is commitMsg');
  return false;
}

Future<bool> preCommit() async {
  print('this is pre-commit');
  return true;
}
34
likes
0
pub points
84%
popularity

Publisher

unverified uploader

Prevents bad commit or push (git hooks, pre-commit/precommit, pre-push/prepush, post-merge/postmerge and all that stuff...).

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

path, yaml

More

Packages that depend on git_hooks