~matthiasbeyer/imag

ref: 9b48dc27cd00fcc75917c2702dc8dc4c6493e8d3 imag/scripts/check-binary-names -rw-r--r-- 404 bytes
9b48dc27Matthias Beyer libimagentryref: Move from error-chain to failure 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env bash

for file in `find bin -type f -name Cargo.toml -o -name main.rs -o -name ui.rs`;
do
    echo "$file" | grep Cargo.toml > /dev/null 2>/dev/null && {
        name=$(cat $file | grep description | sed 's,.*: ,,; s, .*,,')
        
        echo "$file" | grep "$name" > /dev/null 2>/dev/null || {
            echo "Crate in $file is named $name"
            exit 1
        }
    }

done