Skip to content

Force remove empty dist dir on builds#462

Merged
c24t merged 1 commit intoopen-telemetry:masterfrom
c24t:rm-f-dist-on-build
Mar 9, 2020
Merged

Force remove empty dist dir on builds#462
c24t merged 1 commit intoopen-telemetry:masterfrom
c24t:rm-f-dist-on-build

Conversation

@c24t
Copy link
Copy Markdown
Member

@c24t c24t commented Mar 4, 2020

Before #437, scripts/build.sh force-removed old built distributions with rm -rf $DISTDIR/*.

This change caused the build script to fail if the dir was empty, which happens e.g. during automated builds: https://github.com/open-telemetry/opentelemetry-python/commit/1e3768c802465c5c59f944276e89ddd0f66ee70f/checks?check_suite_id=499159591.

@c24t c24t requested a review from a team March 4, 2020 19:49
Copy link
Copy Markdown
Member

@toumorokoshi toumorokoshi left a comment

Choose a reason for hiding this comment

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

I think there's a better alternative, but this is fairly safe.

cd $BASEDIR
mkdir -p $DISTDIR
rm -r $DISTDIR/*
rm -rf $DISTDIR/*
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

could just do a check here:

tsutsumi:/home/tsutsumi (139)
$ [ -z /tmp ] && echo 'foo'
tsutsumi:/home/tsutsumi (1)
$ [ -z /tmp ] || echo 'foo'
foo

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i.e., do the || if the path does exist.

Copy link
Copy Markdown
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

👍

@c24t c24t merged commit 9af7951 into open-telemetry:master Mar 9, 2020
@c24t c24t deleted the rm-f-dist-on-build branch March 9, 2020 19:23
srikanthccv pushed a commit to srikanthccv/opentelemetry-python that referenced this pull request Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants