Skip to content
Snippets Groups Projects
Select Git revision
  • dev_2021_17
  • master_clean default
  • radiator_update
  • update_at_version
  • patch-3
  • patch-2
  • update_trdtype5_nasics
  • master
  • patch-1
  • add_clusterizer_googletests
  • apuntke-master-patch-66704
  • nightly_master
  • apr21_patches
  • dev_2021_47
  • dev_2021_46
  • dev_2021_45
  • dev_2021_44
  • dev_2021_43
  • dev_2021_42
  • dev_2021_41
  • dev_2021_40
  • dev_2021_39
  • dev_2021_38
  • dev_2021_37
  • dev_2021_36
  • dev_2021_35
  • dev_2021_34
  • dev_2021_33
  • dev_2021_32
  • dev_2021_31
  • dev_2021_30
  • dev_2021_29
  • dev_2021_28
33 results

autoinstall_framework.sh

Blame
  • Forked from Computing / cbmroot
    Source project has a limited visibility.
    check-file-format.sh 1.07 KiB
    #!/bin/bash
    # Copyright (C) 2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
    # SPDX-License-Identifier: GPL-3.0-only
    # First commited by Florian Uhlig
    
    
    if [[ $# -eq 1 ]]; then
      UPSTREAM=$1
    else
      if [ -z $UPSTREAM ]; then
        UPSTREAM=$(git remote -v | grep git.cbm.gsi.de[:/]computing/cbmroot | cut -f1 | uniq)
        if [ -z $UPSTREAM ]; then
          echo "Error: Name of upstream repository not provided and not found by automatic means"
          echo 'Please provide if by checking your remotes with "git remote -v" and exporting UPSTREAM'
          echo "or passing as an argument"
          exit -1
        fi
      fi
    fi  
    echo "Upstream name is :" $UPSTREAM
    
    BASE_COMMIT=$UPSTREAM/master
    CHANGED_FILES=$(git diff --name-only $BASE_COMMIT)
    for file in $CHANGED_FILES; do
      result=$(file $file | grep CRLF)
      if [[ "$result" != "" ]]; then
        echo ""
        echo "File $file has wrong file format"
        echo "$result"
        echo ""
        okay=false
      fi
    done
    if [[ "$okay" = "false" ]]; then
      echo ""
      echo "Not all files have the correct file format"
      echo "Test failed"
      exit 1
    else
      exit 0
    fi