コード例 #1
0
ファイル: application_bits.go プロジェクト: nsnt/cli
func (repo CloudControllerApplicationBitsRepository) copyUploadableFiles(appDir string, uploadDir string) (err error) {
	// Find which files need to be uploaded
	allAppFiles, err := cf.AppFilesInDir(appDir)
	if err != nil {
		return
	}

	// Copy files into a temporary directory and return it
	err = cf.CopyFiles(allAppFiles, appDir, uploadDir)
	if err != nil {
		return
	}

	return
}
コード例 #2
0
ファイル: application_bits.go プロジェクト: rodney-vin/cli
func (repo CloudControllerApplicationBitsRepository) copyUploadableFiles(appDir string, uploadDir string) (presentResourcesJson []byte, err error) {
	// Find which files need to be uploaded
	allAppFiles, err := cf.AppFilesInDir(appDir)
	if err != nil {
		return
	}

	appFilesToUpload, presentResourcesJson, apiResponse := repo.getFilesToUpload(allAppFiles)
	if apiResponse.IsNotSuccessful() {
		err = errors.New(apiResponse.Message)
		return
	}

	// Copy files into a temporary directory and return it
	err = cf.CopyFiles(appFilesToUpload, appDir, uploadDir)
	if err != nil {
		return
	}

	return
}