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

moved most yq commands and comments #198

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

Conversation

turbomam
Copy link
Member

No description provided.

Copy link
Collaborator

@pkalita-lbl pkalita-lbl left a comment

Choose a reason for hiding this comment

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

Having a .txt file of partial commands feels a bit ummm quirky to me. Why not a shell script with the commands to run, like

#!/usr/bin/env bash

file="$1"

# ...

yq -i '(.slots.[] | select(.domain == "Activity") | .domain ) = "NamedThing"' "$file"
yq -i '(.slots.[] | select(.domain == "Agent") | .domain ) = "NamedThing"' "$file"

# Or possibly even just pipe the output of one `yq` call into the next to avoid all the in-place file writing

# ...

And then invoke it in the Makefile like:

local/with_shuttles_yq.yaml: local/with_shuttles.yaml
    assets/yq-for-shuttles.sh $@

I think having 1. a file type (.sh) that any editor understands and 2. not having slightly cryptic loops in the Makefile will be more maintainable in the long run.

@mslarae13
Copy link
Contributor

this is implemented to nmdc-schema for mixs classes. Uses the same method.

Some discussion & decision is needed here. Move to discussion

@turbomam turbomam added the yq label Oct 28, 2024
@turbomam
Copy link
Member Author

I recommend closing this in favor of future development that will be triggered by @pkalita-lbl 's

@turbomam turbomam marked this pull request as draft October 28, 2024 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

move yq commands out of project.Makefile and into a configuration file
3 participants