Skip to content

Commit cc2fd29

Browse files
authored
chore(cli): set raw format link (#337)
1 parent 3e4aacd commit cc2fd29

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

cli/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,3 @@ include_trailing_comma = true
6464
force_grid_wrap = 0
6565
use_parentheses = true
6666
ensure_newline_before_comments = true
67-

scripts/install.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ readonly NC='\033[0m'
77

88
# GitHub repository info
99
readonly REPO_URL="https://github.com/raghavyuva/nixopus"
10-
readonly PACKAGE_JSON_URL="$REPO_URL/raw/master/package.json"
10+
11+
readonly PACKAGE_JSON_URL_MASTER="https://raw.githubusercontent.com/raghavyuva/nixopus/master/package.json"
1112

1213
# Logging functions
1314
log_error() { echo -e "${RED}[ERROR]${NC} $1" >&2; }
@@ -49,15 +50,16 @@ detect_os() {
4950
# Get CLI version and package list
5051
get_package_info() {
5152
local package_json
52-
package_json=$(curl -s "$PACKAGE_JSON_URL" || {
53-
log_error "Failed to fetch package.json from repository"
53+
package_json=$(curl -fsSL "$PACKAGE_JSON_URL_MASTER" 2>/dev/null || true)
54+
if [[ -z "$package_json" || "$package_json" != \{* ]]; then
55+
log_error "Failed to fetch package.json from master branch"
5456
exit 1
55-
})
56-
57+
fi
58+
5759
# Extract version and packages
5860
CLI_VERSION=$(echo "$package_json" | grep -o '"cli-version":[[:space:]]*"[^"]*"' | cut -d'"' -f4)
59-
CLI_PACKAGES=$(echo "$package_json" | grep -A 100 '"cli-packages"' | sed -n '/\[/,/\]/p' | grep -o '"[^"]*\..*"' | tr -d '"')
60-
61+
CLI_PACKAGES=$(echo "$package_json" | grep -A 200 '"cli-packages"' | sed -n '/\[/,/\]/p' | grep -o '"[^"]*\..*"' | tr -d '"')
62+
6163
if [[ -z "$CLI_VERSION" ]]; then
6264
log_error "Could not find cli-version in package.json"
6365
exit 1

0 commit comments

Comments
 (0)