diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 82d9ff6a75044595e0e28e17960035087f30a59c..c35f133bf8a1ff575116b492ef2b53853e154741 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,11 +1,11 @@ - repo: git://github.com/pre-commit/pre-commit-hooks - sha: 97b88d9610bcc03982ddac33caba98bb2b751f5f + sha: v0.7.1 hooks: - id: check-added-large-files - id: check-yaml - id: check-merge-conflict - repo: https://www.shore.co.il/git/shell-pre-commit/ - sha: v0.1.0 + sha: v0.3.0 hooks: - id: shell-lint files: ssh-ca @@ -14,5 +14,5 @@ - id: test name: make test language: system - entry: make test + entry: make clean test files: ssh-ca|Makefile diff --git a/Makefile b/Makefile index f7dc457bf7226fa9aa64e1cc582dd6511a141b0f..ca86312002bd7abcfbbacd4b6520a06316d5cd21 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,10 @@ -.PHONY: install test +.PHONY: install test clean USERNAME = $$(whoami) +clean: + git clean -fdx + test: ssh_config sshd_config CA CA.pub users/$(USERNAME) hosts/localhost known_hosts $$(PATH=$$PATH:/usr/local/sbin:/usr/sbin:/sbin which sshd) -f sshd_config test "$$(ssh -F ssh_config test whoami)" = "$$USER" diff --git a/ssh-ca b/ssh-ca index 9a7b3d9da9a798368f9a0c6a427ec8c6a0998246..a0e812eb6cceb4a96dda99df8e2771a61beff6b7 100755 --- a/ssh-ca +++ b/ssh-ca @@ -1,4 +1,5 @@ -#!/bin/sh -e +#!/bin/sh +set -eu error () { echo "$1"