Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Лабараторная работа 5

Задача 1

  1. Я создал файл pre-commit в /Users/arpo/git-lab/.git/hooks
  2. Написал скрипт
#!/bin/bash
FILES=$(git diff --cached --name-only)
flag=0
for val in $FILES; do
	if ! [ -s "$val" ]; then
		echo "Error: File '$val' does not exist or is empty."
		flag=1
	fi
	if [[ "$val" != *.txt ]]; then
        echo "Error: File '$val' is not a .txt file."
        flag=1
    fi
done

if [[ $flag = 1 ]]; then
	exit 1
fi
  1. Проверка:

Снимок экрана 2024-12-10 в 21 38 02

Задача 2

Снимок экрана 2024-12-11 в 14 52 13

Снимок экрана 2024-12-11 в 14 52 26

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors