Merge pull request #46829 from cblecker/swagger-dir-fix

Automatic merge from submit-queue (batch tested with PRs 47921, 45984, 46829, 46896, 46923)

Create output_dir if doesn't exist

**What this PR does / why we need it**:
Minor fix to the swagger spec gen, that if the directory doesn't exist, create it before copying.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
pull/6/head
Kubernetes Submit Queue 2017-06-22 20:26:24 -07:00 committed by GitHub
commit a509cbf919
1 changed files with 3 additions and 0 deletions

View File

@ -154,6 +154,9 @@ kube::swagger::gen_api_ref_docs() {
echo "Moving api reference docs from ${output_tmp} to ${output_dir}"
# Create output_dir if doesn't exist. Prevents error on copy.
mkdir -p "${output_dir}"
cp -af "${output_tmp}"/* "${output_dir}"
rm -r "${output_tmp}"
}