Skip to content

Commit

Permalink
fix: fix publish shell script
Browse files Browse the repository at this point in the history
  • Loading branch information
afonsobarracha committed Aug 7, 2024
1 parent 92cfe94 commit 724fc56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions wrappers/react-native/scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ export PATH="$PATH:node_modules/.bin"
# Fetch the current version from the package.json
new_version=$(node -pe "require('./package.json').version")

# Fetch package name
package_name=$(node -pe "require('./package.json').name")

# Check if the new version is not the current
new_version_exists=$(yarn info '@mattrglobal/pairing-crypto-rn' --json | jq --arg version "$new_version" -r '.data.versions | any(index($version))')
new_version_exists=$(yarn info $package_name --json | jq --arg version "$new_version" -r '.data.versions | any(index($version))')

# Version to this new unstable version
if [[ "$new_version_exits" != "true" ]]; then
if [[ "$new_version_exits" == "true" ]]; then
yarn publish --no-git-tag-version --new-version $new_version
fi
# Reset changes to the package.json
Expand Down
7 changes: 5 additions & 2 deletions wrappers/wasm/scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ set -e
# Add dev dependencies to current path
export PATH="$PATH:node_modules/.bin"

# Fetch package name
package_name=$(node -pe "require('./package.json').name")

# Fetch the current version from the package.json
new_version=$(node -pe "require('./package.json').version")

# Check if the new version is not the current
new_version_exists=$(yarn info '@mattrglobal/pairing-crypto' --json | jq --arg version "$new_version" -r '.data.versions | any(index($version))')
new_version_exists=$(yarn info $package_name --json | jq --arg version "$new_version" -r '.data.versions | any(index($version))')

# Version to this new unstable version
if [[ "$new_version_exits" != "true" ]]; then
if [[ "$new_version_exits" == "true" ]]; then
yarn publish --no-git-tag-version --new-version $new_version
fi

Expand Down

0 comments on commit 724fc56

Please sign in to comment.