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

Check if artifactdir exists early #429

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

obbardc
Copy link
Member

@obbardc obbardc commented Aug 11, 2023

Currently debos fails if an action attempts to use artifactdir and it doesn't exist on the host:

$ debos --artifactdir=out rpi64/debimage-rpi64.yaml
Action image-partition failed at stage PreMachine, error: open /home/obbardc/projects/debos/debos-recipes/out/debian-rpi64.img: no such file or directory

Check that artifactdir exists early and return an error in case that it does not exist.

Closes: #426

Currently debos fails if an action attempts to use artifactdir and it
doesn't exist on the host:

  $ debos --artifactdir=out rpi64/debimage-rpi64.yaml
  Action `image-partition` failed at stage PreMachine, error: open /home/obbardc/projects/debos/debos-recipes/out/debian-rpi64.img: no such file or directory

Check that artifactdir exists early and return an error in case that it
does not exist.

Closes: #426
Signed-off-by: Christopher Obbard <[email protected]>
@obbardc obbardc self-assigned this Aug 11, 2023
@obbardc obbardc force-pushed the wip/obbardc/artifactdir-improvements branch from e3869f8 to f334d32 Compare August 15, 2023 10:24
@evelikov
Copy link

evelikov commented Oct 3, 2023

Do we need a test case for this?

@obbardc obbardc added this to the v1.1.4 milestone Jan 10, 2024
@@ -192,6 +192,11 @@ func main() {
context.Artifactdir, _ = os.Getwd()
}
context.Artifactdir = debos.CleanPath(context.Artifactdir)
if _, err := os.Stat(context.Artifactdir); os.IsNotExist(err) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should check if it's a Dir as well :)

Copy link
Member

@sjoerdsimons sjoerdsimons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if it's a dir not just that it's "something"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Review required
Development

Successfully merging this pull request may close these issues.

Create artifactdir if it does not exist
3 participants