diff --git a/libs/hooks/open-telemetry/package.json b/libs/hooks/open-telemetry/package.json index ec0a73b4a..eef912abc 100644 --- a/libs/hooks/open-telemetry/package.json +++ b/libs/hooks/open-telemetry/package.json @@ -11,7 +11,7 @@ "access": "public" }, "scripts": { - "publish-if-not-exists": "cp $NPM_CONFIG_USERCONFIG .npmrc && if [[ $(npm show $npm_package_name@$npm_package_version version) = $(npm run current-version -s) ]]; then echo 'already published, skipping'; else npm publish --access public; fi", + "publish-if-not-exists": "cp $NPM_CONFIG_USERCONFIG .npmrc && if [ $(npm show $npm_package_name@$npm_package_version version) = $(npm run current-version -s) ]; then echo 'already published, skipping'; else npm publish --access public; fi", "current-version": "echo $npm_package_version" }, "license": "Apache-2.0" diff --git a/libs/hooks/open-telemetry/src/lib/open-telemetry-hook.spec.ts b/libs/hooks/open-telemetry/src/lib/open-telemetry-hook.spec.ts index 4016a4231..a6c9832f6 100644 --- a/libs/hooks/open-telemetry/src/lib/open-telemetry-hook.spec.ts +++ b/libs/hooks/open-telemetry/src/lib/open-telemetry-hook.spec.ts @@ -113,6 +113,21 @@ describe('OpenTelemetry Hooks', () => { 'true' ); }); + + it('should set the value without extra quotes if value is already string', () => { + const evaluationDetails: EvaluationDetails = { + flagKey: hookContext.flagKey, + value: 'already-string', + }; + + otelHook.before(hookContext); + otelHook.after(hookContext, evaluationDetails); + + expect(setAttribute).toBeCalledWith( + 'feature_flag.evaluated_value', + 'already-string' + ); + }); }); describe('error hook', () => { diff --git a/libs/providers/go-feature-flag/package.json b/libs/providers/go-feature-flag/package.json index ff22354d1..ca0e803ed 100644 --- a/libs/providers/go-feature-flag/package.json +++ b/libs/providers/go-feature-flag/package.json @@ -6,7 +6,7 @@ "@openfeature/nodejs-sdk": "^0.0.1" }, "scripts": { - "publish-if-not-exists": "cp $NPM_CONFIG_USERCONFIG .npmrc && if [[ $(npm show $npm_package_name@$npm_package_version version) = $(npm run current-version -s) ]]; then echo 'already published, skipping'; else npm publish --access public; fi", + "publish-if-not-exists": "cp $NPM_CONFIG_USERCONFIG .npmrc && if [ $(npm show $npm_package_name@$npm_package_version version) = $(npm run current-version -s) ]; then echo 'already published, skipping'; else npm publish --access public; fi", "current-version": "echo $npm_package_version" } } \ No newline at end of file diff --git a/tools/generators/open-feature/index.ts b/tools/generators/open-feature/index.ts index 7dce3afd0..bb5d39111 100644 --- a/tools/generators/open-feature/index.ts +++ b/tools/generators/open-feature/index.ts @@ -170,7 +170,7 @@ function updatePackage(tree: Tree, projectRoot: string) { updateJson(tree, joinPathFragments(projectRoot, 'package.json'), (json) => { json.scripts = { 'publish-if-not-exists': - "cp $NPM_CONFIG_USERCONFIG .npmrc && if [[ $(npm show $npm_package_name@$npm_package_version version) = $(npm run current-version -s) ]]; then echo 'already published, skipping'; else npm publish --access public; fi", + "cp $NPM_CONFIG_USERCONFIG .npmrc && if [ $(npm show $npm_package_name@$npm_package_version version) = $(npm run current-version -s) ]; then echo 'already published, skipping'; else npm publish --access public; fi", 'current-version': 'echo $npm_package_version', };