-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into more-groq-models
- Loading branch information
Showing
205 changed files
with
3,165 additions
and
4,582 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
# Check if the correct number of arguments is provided | ||
if [ "$#" -ne 2 ]; then | ||
echo "Usage: $0 <path_to_json_input_file> <channel>" | ||
exit 1 | ||
fi | ||
|
||
INPUT_JSON_FILE="$1" | ||
|
||
CHANNEL="$2" | ||
|
||
if [ "$CHANNEL" == "nightly" ]; then | ||
UPDATER="latest" | ||
else | ||
UPDATER="beta" | ||
fi | ||
|
||
# Check if the input file exists | ||
if [ ! -f "$INPUT_JSON_FILE" ]; then | ||
echo "Input file not found: $INPUT_JSON_FILE" | ||
exit 1 | ||
fi | ||
|
||
# Use jq to transform the content | ||
jq --arg channel "$CHANNEL" --arg updater "$UPDATER" ' | ||
.name = "jan-\($channel)" | | ||
.productName = "Jan-\($channel)" | | ||
.build.appId = "jan-\($channel).ai.app" | | ||
.build.productName = "Jan-\($channel)" | | ||
.build.appId = "jan-\($channel).ai.app" | | ||
.build.protocols[0].name = "Jan-\($channel)" | | ||
.build.protocols[0].schemes = ["jan-\($channel)"] | | ||
.build.artifactName = "jan-\($channel)-${os}-${arch}-${version}.${ext}" | | ||
.build.publish[0].channel = $updater | ||
' "$INPUT_JSON_FILE" > ./package.json.tmp | ||
|
||
cat ./package.json.tmp | ||
|
||
rm $INPUT_JSON_FILE | ||
mv ./package.json.tmp $INPUT_JSON_FILE | ||
|
||
# Update the layout file | ||
LAYOUT_FILE_PATH="web/app/layout.tsx" | ||
|
||
if [ ! -f "$LAYOUT_FILE_PATH" ]; then | ||
echo "File does not exist: $LAYOUT_FILE_PATH" | ||
exit 1 | ||
fi | ||
|
||
# Perform the replacements | ||
sed -i -e "s#Jan#Jan-$CHANNEL#g" "$LAYOUT_FILE_PATH" | ||
|
||
# Notify completion | ||
echo "File has been updated: $LAYOUT_FILE_PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.