aboutsummaryrefslogtreecommitdiffstats
path: root/.github/check_dirs.sh
blob: 6ab47851cb00d587f65304136e992ac7a738f8e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash

GIT_URL=$1

set -e
declare -A top_dirs=(
    [ydb/]=1,
    [util/]=1,
    [build/]=1,
    [contrib/]=1,
    [certs/]=1,
    [cmake/]=1,
    [.git/]=1,
    [.github/]=1,
    [library/]=1,
    [tools/]=1,
    [scripts/]=1,
    [yt/]=1,
    [vendor/]=1,
    [devtools/]=1,
)

cd $GIT_URL

shopt -s dotglob
shopt -s nullglob
array=(*/)

for dir in "${array[@]}"
do
    if [[ ! ${top_dirs[$dir]} ]]
    then
        echo "$dir is not allowed root level directory."
        exit 1
    fi
done