Check that an svn repository url does not exist

后端 未结 6 1205
别那么骄傲
别那么骄傲 2021-02-01 12:47

I am writing a script which will add a new project in the repository, based on the name supplied by the user. Part of this involves checking that an url with the same name does

6条回答
  •  旧巷少年郎
    2021-02-01 13:27

    I face the above problem and i tried all the way. not work for me.. if we access svn with a path not in svn it's failed with error and the shell script will break.

    Instead of accessing unknown path, what i did is get the directory list of parent folder and check whether matching one contain or not.

    Get all the projects form your Parent directory (if you want to find a specific tags then your parent directory path should be https://developernetwork.repo.net/svn/Projects/Calculator/tags)

    projects=$(svn ls https://developernetwork.repo.net/svn/Projects/)
    

    then check your project folder exists. Remember to add / after your project name.

    projectName="Calculator/"
    for i in $projects; do 
        if [ "$i" == "$projectName/" ];
            then
            echo Project Exist
            else
            echo Project does not exist
        fi
    done 
    

    simple.

提交回复
热议问题