Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug, this should check if the directory exists to correctly return that a direct... #73

Open
github-actions bot opened this issue Oct 17, 2023 · 0 comments
Assignees
Labels

Comments

@github-actions
Copy link
Contributor

https://api.github.com/gogrlx/grlx/blob/7ac33a5c0dc7b3900a3d9ee13c6389ac95a61dad/ingredients/file/fileDirectory.go#L58

		// create the dir if "makeDirs" is true or not defined
		if val, ok := f.params["makedirs"].(bool); ok && val || !ok {
			d.makeDirs = true
			if test {
				notes = append(notes, types.Snprintf("would create directory %s", name))
			} else {
				// TODO: Bug, this should check if the directory exists to correctly return that a directory altready exists and it is being skipped for creation
				errCreate := os.MkdirAll(name, 0o755)
				notes = append(notes, types.Snprintf("creating directory %s", name))
				if errCreate != nil {
					return types.Result{
						Succeeded: false, Failed: true, Notes: notes,
					}, errCreate
				}

			}

		}
	}
	// chown the directory to the named user
	{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant