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

Build Pipeline #3

Open
skilesare opened this issue Aug 11, 2022 · 1 comment
Open

Build Pipeline #3

skilesare opened this issue Aug 11, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@skilesare
Copy link
Collaborator

I'm trying to come up with the best way to compile a directory and out-put it into another directory.

I was hoping the following would work, but doesn't seem to:

kusanagi < ./src/origyn_nft_reference_ku/**/*.ku > ./src/origyn_nft_reference_mo/**/*.mo 

I probably need a bash script here but my bash is awful. Suggestions welcome and then we can add it to the read me.

@STRd6
Copy link
Contributor

STRd6 commented Aug 11, 2022

I'd do something like this:

#!/bin/bash
set -euo pipefail

SRC_DIR="src/origyn_nft_reference_ku/"
DEST_DIR="src/origin_nft_reference_mo/"

for KU in `find $SRC_DIR -type f -name "*.ku"`; do
  FILE="${KU#$SRC_DIR}"
  NAME="${FILE%.ku}"

  MO="$DEST_DIR$NAME.mo"

  SUB_DIR=`dirname $MO`
  mkdir -p "$SUB_DIR"

  echo "Transpiling $KU > $MO"
  kusanagi < "$KU" > "$MO"
done

Later I can improve the cli tool with more cli options for input directory, watching changes, and setting an output directory.

@STRd6 STRd6 added the enhancement New feature or request label Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants