처럼 보이는 bash 스크립트를 사용했습니다. VERY 라운드 집 방법. 나는 누군가가 더 좋은 대답을 제공 할 수 있다고 확신하지만 주위의 일로 생각합니다.
다음 함수는 추가해야 할 파일 목록을 가져와 Source Safe의 해당 디렉토리에 추가합니다. 해당 파일이 sourcesafe에 아직 존재하지 않는 디렉토리에 존재하면 해당 디렉토리는 자동으로 에 자동으로 추가됩니다.
사용 예제 (프로젝트의 루트에있는 동안) :
SSAddEachNewFile file1.txt file2.txt folder1/file3.txt folder1/morefolder/file4.txt
이
에은 File2.txt file2.txt 폴더 1/file3.txt 폴더 1/morefolder/file4.txt 추가 할
$/프로젝트/현재/MyProject를 /은 file2.txt
$/프로젝트/전류/myproject라는/file2.txt
$/프로젝트/전류/myproject라는/폴더 1/file3.txt
$/프로젝트/전류/myproject라는/폴더 1/morefolder/file4 .txt
개
배쉬 기능 :
SSAddEachNewFile()
{
printf "\n\nAdding files requires us to loop, so we can add to the correct directory"
for file in $1; do
printf "\n--Resetting Dir---\n"
cd %CURRENT_PROJECT_WORKING_DIR
quietsset
printf " ----\n\n"
new_file=$(echo ${file##*/})
directory=$(echo ${file%/*})
#cp to folder
echo "Directory is: $directory"
quietsset
test=$(ss CP $directory 2>&1 | grep -c 'exist' 2>&1)
if (("1"== $test));
then
echo "Did not to find directory! It does not exist!....yet :)";
new_directory=$directory;
last_directory=$directory;
while (("1"== $test));
do
echo "->This parent directory does not exist, try going up";
echo "---trying to cp to $new_directory"
last_directory=$(echo ${new_directory})
new_directory=$(echo ${new_directory%/*})
quietsset
test=$(ss CP $new_directory 2>&1 | grep -c 'exist' 2>&1)
echo "[+]"
done
echo "Directory does not exit, need to add $last_directory";
ss Add $last_directory -R -C"$SS_COMMENT" -Y$SSNAME
else
echo "Directory already exists, need to add file: ${file}";
ss Add $file -C"$SS_COMMENT" -Y$SSNAME
fi
done
}
그것은 하나 개의 추가 기능이 환경 변수를 필요로
quietsset()
{
ss CP $CURRENT_SOURCE_SAFE_PROJECT -O-
}
$ CURRENT_SOURCE_SAFE_PROJECT이 SS 루트와 $ %의 CURRENT_PROJECT_WORKING_DIR입니다
는 작업 디렉토리의 루트입니다 .
프로젝트/현재/myproject가 있고 체크 아웃하면 "myproject"폴더 구조가 있습니다. 그런 다음
CURRENT_SOURCE_SAFE_PROJECT = $/프로젝트/전류/myproject라는 및 CURRENT_PROJECT_WORKING_DIR = C/어디에서/당신은/넣어/myproject라는