示例#1
0
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
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
}