Package Details: devcontainer-cli 0.67.0-1

Git Clone URL: https://aur.archlinux.org/devcontainer-cli.git (read-only, click to copy)
Package Base: devcontainer-cli
Description: Dev container CLI, which can take a devcontainer.json and create and configure a dev container from it.
Upstream URL: https://github.com/devcontainers/cli
Licenses: MIT
Submitter: tjquillan
Maintainer: tjquillan
Last Packager: tjquillan
Votes: 5
Popularity: 0.002095
First Submitted: 2022-06-10 03:16 (UTC)
Last Updated: 2024-07-31 17:16 (UTC)

Latest Comments

mistekko commented on 2024-07-31 17:12 (UTC)

mms, you had truncated lines when copying that from your editor so it looks like you are missing a fair bit of that file.

mms commented on 2024-07-03 15:23 (UTC) (edited on 2024-11-09 17:12 (UTC) by mms)

# Maintainer: Thomas Quillan <tjquillan@gmail.com>

pkgname=devcontainer-cli
_npm_namespace="@devcontainers"
_npm_name="cli"
pkgver=0.65.0
pkgrel=1
pkgdesc="Dev container CLI, which can take a devcontainer.json and create and configure a dev container from it."
arch=("any")
url="https://github.com/devcontainers/cli"
license=("MIT")
depends=("nodejs")
makedepends=("npm" "jq")
optdepends=()
source=("https://registry.npmjs.org/${_npm_namespace}/${_npm_name}/-/${_npm_name}-${pkgver}.tgz")
sha256sums=('0fad0a0cb19728cfb59315598e9baf0f085857e510bdc17593fa751bf6ff2c41')
noextract=("${_npm_name}-${pkgver}.tgz")

package() {
        npm install -g --cache "${srcdir}/npm-cache" --prefix "${pkgdir}/usr" "${srcdir}/${_npm_name}-${pkgver}.tgz"

        # npm gives ownership of ALL FILES to build user
        # https://bugs.archlinux.org/task/63396
        chown -R root:root "${pkgdir}"

        # Remove references to $pkgdir
        find "${pkgdir}" -type f -name package.json -print0 | xargs -0 sed -i "/_where/d"

        # Remove references to $srcdir
        local tmppackage="$(mktemp)"
        local pkgjson="${pkgdir}/usr/lib/node_modules/${_npm_namespace}/${_npm_name}/package.json"
        jq '.|=with_entries(select(.key|test("_.+")|not))' "${pkgjson}" > "${tmppackage}"
        mv "${tmppackage}" "${pkgjson}"
        chmod 644 "${pkgjson}"
}