Skip to content

Commit

Permalink
apply suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
samruddhikhandale committed Jan 5, 2023
1 parent a700cfe commit 36325b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
7 changes: 2 additions & 5 deletions src/spec-configuration/containerFeaturesConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ export function getFeatureInstallWrapperScript(feature: Feature, featureSet: Fea
warningHeader += `(!) WARNING: This feature has been renamed. Please update the reference in devcontainer.json to "${escapeQuotesForShell(feature.currentId)}".`;
}

const echoWarning = warningHeader ? `echo '${warningHeader}'` : '';
const errorMessage = `ERROR: Feature "${name}" (${id}) failed to install!`;
const troubleshootingMessage = documentation
? ` Look at the documentation at ${documentation} for help troubleshooting this error.`
Expand All @@ -281,11 +282,7 @@ on_exit () {
trap on_exit EXIT
echo ===========================================================================
if [ "${warningHeader}" != '' ]
then
echo '${warningHeader}'
fi
${echoWarning}
echo 'Feature : ${name}'
echo 'Description : ${description}'
echo 'Id : ${id}'
Expand Down
20 changes: 2 additions & 18 deletions src/test/container-features/featureHelpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,6 @@ on_exit () {
trap on_exit EXIT
echo ===========================================================================
if [ "" != '' ]
then
echo ''
fi
echo 'Feature : Unknown'
echo 'Description : '
Expand Down Expand Up @@ -565,10 +561,6 @@ on_exit () {
trap on_exit EXIT
echo ===========================================================================
if [ "" != '' ]
then
echo ''
fi
echo 'Feature : My Test Feature'
echo 'Description : This is an awesome feature (with ""quotes" for '\\''escaping'\\'' test)'
Expand Down Expand Up @@ -651,11 +643,7 @@ on_exit () {
trap on_exit EXIT
echo ===========================================================================
if [ "(!) WARNING: Using the deprecated Feature "test". This Feature will no longer receive any further updates/support.\n" != '' ]
then
echo '(!) WARNING: Using the deprecated Feature "test". This Feature will no longer receive any further updates/support.\n'
fi
echo '(!) WARNING: Using the deprecated Feature "test". This Feature will no longer receive any further updates/support.\n'
echo 'Feature : My Test Feature'
echo 'Description : This is an awesome feature (with ""quotes" for '\\''escaping'\\'' test)'
echo 'Id : ghcr.io/my-org/my-repo/test'
Expand Down Expand Up @@ -740,11 +728,7 @@ on_exit () {
trap on_exit EXIT
echo ===========================================================================
if [ "(!) WARNING: This feature has been renamed. Please update the reference in devcontainer.json to "ghcr.io/my-org/my-repo/new-test"." != '' ]
then
echo '(!) WARNING: This feature has been renamed. Please update the reference in devcontainer.json to "ghcr.io/my-org/my-repo/new-test".'
fi
echo '(!) WARNING: This feature has been renamed. Please update the reference in devcontainer.json to "ghcr.io/my-org/my-repo/new-test".'
echo 'Feature : My New Test Feature'
echo 'Description : This is an awesome feature (with ""quotes" for '\\''escaping'\\'' test)'
echo 'Id : ghcr.io/my-org/my-repo/test'
Expand Down

0 comments on commit 36325b6

Please sign in to comment.