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

Force remove empty dist dir on builds #462

Merged
merged 1 commit into from
Mar 9, 2020

Conversation

c24t
Copy link
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
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.

@@ -14,7 +14,7 @@ DISTDIR=dist
(
cd $BASEDIR
mkdir -p $DISTDIR
rm -r $DISTDIR/*
rm -rf $DISTDIR/*
Copy link
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
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
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