openshift / ocm-container

Containerized environment for accessing OpenShift v4 clusters, packing necessary tools/scripts
Apache License 2.0
10 stars 63 forks source link

create config folder before creating config file within it #283

Closed erdii closed 2 months ago

erdii commented 2 months ago

Hey :)

ocm-container configure init fails to save the config file when the folder ~/.config/ocm-container doesn't exist. This PR fixes it by adding the equivalent of mkdir -p "$(dirname "$cfgFile")" before the call to viper.WriteConfig()

image

Edit: sorry for reformatting the unrelated else-statement. I couldn't resist! :sweat_smile:

T0MASD commented 2 months ago

/lgtm

openshift-ci[bot] commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: erdii, T0MASD

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/openshift/ocm-container/blob/master/OWNERS)~~ [T0MASD] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment