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

Update copy command in MkDocs build instruction to prevent copying to wrong location #1148

Open
wants to merge 5 commits into
base: development/v3.0.1
Choose a base branch
from

Conversation

bact
Copy link
Collaborator

@bact bact commented Nov 14, 2024

Adjust copy command in the instruction to make it still copy individual subdirs inside parser_output/mkdocs dir (but not the mkdocs dir itself), even if spdx-spec/docs/model/and spdx-spec/docs/rdf dirs are already exists.

What is wrong?

If spdx-spec/docs/model/ exists, the current command:

cp -R parser_output/mkdocs spdx-spec/docs/model 

will results this content inside the spdx-spec/docs/model/ dir:

mkdocs

which is not what we want. We want the subdirs to be copied at this level, as MkDocs expected.

What this PR do?

This PR update the command to:

mkdir -p spdx-spec/docs/model
cp -R parser_output/mkdocs/* spdx-spec/docs/model 

which will give this expected result in the spdx-spec/docs/model/ dir, no matter if the dir exists before or not:

AI			Dataset			Licensing		SimpleLicensing
Build			ExpandedLicensing	Lite			Software
Core			Extension		Security

This is new command also to prevent the case that the user may already have model subdirs inside spdx-spec/docs/model/ dir from a previous run of spec generation and want to try another run. When they make copy with the current copy command, it will results to the below content (note the mkdocs subdir at the last row at the very end):

AI			Dataset			Licensing		SimpleLicensing
Build			ExpandedLicensing	Lite			Software
Core			Extension		Security		mkdocs

This will lead to MkDocs errors.

Adjust copy command to make it still copy individual subdirs inside mkdocs dir (but not the mkdocs dir itself), if spdx-spec/docs/model/ and spdx-spec/docs/rdf/ are already exists.

Signed-off-by: Arthit Suriyawongkul <[email protected]>
@bact bact added doc improvement Area where the project documentation needs improvement ci Dev workflow and repo management labels Nov 14, 2024
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Copy link
Member

@goneall goneall left a comment

Choose a reason for hiding this comment

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

LGTM

@goneall goneall requested review from zvr and licquia November 14, 2024 18:37
@goneall goneall added this to the 3.1 milestone Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Dev workflow and repo management doc improvement Area where the project documentation needs improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants