Skip to content

Instantly share code, notes, and snippets.

@FrankHassanabad
Created January 25, 2020 06:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FrankHassanabad/eefe3fc8faa295a48b13adfa5cef5390 to your computer and use it in GitHub Desktop.
Save FrankHassanabad/eefe3fc8faa295a48b13adfa5cef5390 to your computer and use it in GitHub Desktop.
json to toml
#!/bin/sh
# Download yj from:
# https://github.com/sclevine/yj/releases
# such as wget https://github.com/sclevine/yj/releases/download/v4.0.0/yj-macos
#
# Then chmod 755 ./yj-macos and chmod 755 toml_to_json.sh
# Go to your toml and run this
# toml_to_json.sh
rm -rf ./toml
mkdir -p toml
for f in *.json ; do
name=$(basename -- "$f" .json).toml
cat $f | ./yj-macos -jt > toml/"${name}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment