generated from devcontainers/feature-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
197 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "@google/clasp (via npm)", | ||
"id": "google-clasp", | ||
"version": "1.0.0", | ||
"description": "Install the @google/clasp with @types/google-apps-script package via NPM registry", | ||
"options": { | ||
"version": { | ||
"type": "string", | ||
"proposals": ["latest"], | ||
"default": "latest", | ||
"description": "Select or enter a @google/clasp version." | ||
}, | ||
"types": { | ||
"type": "string", | ||
"proposals": ["latest"], | ||
"default": "latest", | ||
"description": "Select or enter a @types/google-apps-script version(pass blank to not install)." | ||
} | ||
}, | ||
"installsAfter": [ | ||
"ghcr.io/devcontainers/features/common-utils", | ||
"ghcr.io/devcontainers/features/node" | ||
] | ||
} |
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,40 @@ | ||
#!/usr/bin/env bash | ||
|
||
TARGET_PACKAGE="@google/clasp" | ||
TARGET_VERSION=${VERSION:-"latest"} | ||
TARGET_TYPES_PACKAGE="@types/google-apps-script" | ||
TARGET_TYPES_VERSION=${TYPES:-"latest"} | ||
|
||
set -e | ||
|
||
|
||
# https://github.com/Balazs23/devcontainers-features/blob/main/src/nx/install.sh | ||
command_exists() { | ||
command -v "$@" > /dev/null 2>&1 | ||
} | ||
install_packages() { | ||
# Use a custom cache since it is unclear how the cache is handled in the feature. | ||
# (whether it should be deleted or kept) | ||
local TEMP_CACHE | ||
TEMP_CACHE=$(mktemp -d) | ||
trap 'rm -rf "${TEMP_CACHE}"' EXIT | ||
|
||
echo "Installing npm package: ${TARGET_PACKAGE}@${TARGET_VERSION}" | ||
npm install --global --omit=dev --no-progress --cache "${TEMP_CACHE}" "${TARGET_PACKAGE}@${TARGET_VERSION}" | ||
if test "${TARGET_TYPES_PACKAGE}" != ""; then | ||
echo "Installing npm package: ${TARGET_TYPES_PACKAGE}@${TARGET_TYPES_VERSION}" | ||
npm install --global --omit=dev --no-progress --cache "${TEMP_CACHE}" "${TARGET_TYPES_PACKAGE}@${TARGET_TYPES_VERSION}" | ||
fi | ||
} | ||
|
||
# Check if npm is installed | ||
if ! command_exists npm; then | ||
echo -e 'Feature requires npm to be installed. Please use a node-based image like:' | ||
# shellcheck disable=SC2016 | ||
echo -e ' - mcr.microsoft.com/vscode/devcontainers/typescript-node:${VARIANT}' | ||
echo -e 'You can also add as feature like:' | ||
echo -e ' - "ghcr.io/devcontainers/features/node:1": {}' | ||
fi | ||
|
||
# Instal pacakges | ||
install_packages |
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,50 @@ | ||
{ | ||
"v2.4.0": { | ||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:1": { | ||
"installZsh": false, | ||
"installOhMyZsh": false, | ||
"upgradePackages": false, | ||
"username": "node" | ||
}, | ||
"ghcr.io/devcontainers/features/node:1": {}, | ||
"google-clasp": { | ||
"version": "2.4.0" | ||
} | ||
}, | ||
"remoteUser": "node" | ||
}, | ||
"types_v1.0.0": { | ||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:1": { | ||
"installZsh": false, | ||
"installOhMyZsh": false, | ||
"upgradePackages": false, | ||
"username": "node" | ||
}, | ||
"ghcr.io/devcontainers/features/node:1": {}, | ||
"google-clasp": { | ||
"types": "1.0.0" | ||
} | ||
}, | ||
"remoteUser": "node" | ||
}, | ||
"types_none": { | ||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:1": { | ||
"installZsh": false, | ||
"installOhMyZsh": false, | ||
"upgradePackages": false, | ||
"username": "node" | ||
}, | ||
"ghcr.io/devcontainers/features/node:1": {}, | ||
"google-clasp": { | ||
"types": "" | ||
} | ||
}, | ||
"remoteUser": "node" | ||
} | ||
} |
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,21 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# -i で npm が使えるイメージを指定する必要がある。 | ||
# test-autogenerated ジョブでは matrix から外す。 | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
# Provides the 'check' and 'reportResults' commands. | ||
# shellcheck source=/dev/null | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
# The 'check' command comes from the dev-container-features-test-lib. | ||
|
||
check "Check @google/clasp is installed" clasp --version | ||
check "Check types(@types/google-apps-script) is installed" npm list --global --depth 0 | grep -q "@types/google-apps-script@" | ||
|
||
# Report result | ||
# If any of the checks above exited with a non-zero exit code, the test will fail. | ||
reportResults |
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,17 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
# Provides the 'check' and 'reportResults' commands. | ||
# shellcheck source=/dev/null | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
# The 'check' command comes from the dev-container-features-test-lib. | ||
check "Check @google/clasp is installed" clasp --version | ||
check "Check types(@types/google-apps-script) is not installed" npm list --global --depth 0 | grep -v -q "@types/google-apps-script@" | ||
|
||
# Report result | ||
# If any of the checks above exited with a non-zero exit code, the test will fail. | ||
reportResults |
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,17 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
# Provides the 'check' and 'reportResults' commands. | ||
# shellcheck source=/dev/null | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
# The 'check' command comes from the dev-container-features-test-lib. | ||
check "Check @google/clasp is installed" clasp --version | ||
check "Check types(@types/google-apps-script) is installed" npm list --global --depth 0 | grep -q "@types/google-apps-script@1.0.0" | ||
|
||
# Report result | ||
# If any of the checks above exited with a non-zero exit code, the test will fail. | ||
reportResults |
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,18 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
# Provides the 'check' and 'reportResults' commands. | ||
# shellcheck source=/dev/null | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
# The 'check' command comes from the dev-container-features-test-lib. | ||
# clasp 2.4.0 は動作しないので、パッケージの存在確認のみ行う。 | ||
check "Check @google/clasp@2.4.0 is installed" npm list --global --depth 0 | grep -q "@google/clasp@2.4.0" | ||
check "Check types(@types/google-apps-script) is installed" npm list --global --depth 0 | grep -q "@types/google-apps-script@" | ||
|
||
# Report result | ||
# If any of the checks above exited with a non-zero exit code, the test will fail. | ||
reportResults |