From e4fe10b3af3cf2532a5c9dcf06c11d8a286f89ba Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sat, 13 Jan 2024 08:40:22 -0500 Subject: [PATCH] Allow pkgxdev/demo-test-pattern without a formal README description --- .github/scripts/index.ts | 6 +++++- .github/workflows/ci.yml | 5 +++-- scripts/{demo => demo-test-pattern} | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) rename scripts/{demo => demo-test-pattern} (92%) diff --git a/.github/scripts/index.ts b/.github/scripts/index.ts index d075191..0b0e300 100755 --- a/.github/scripts/index.ts +++ b/.github/scripts/index.ts @@ -137,7 +137,11 @@ async function get_metadata(slug: string) { const fullname = join(dirname(slug), _stem) const url = repo_metadata.url +'/scripts/' + basename(filename) const category = (([x, y]) => x?.length > 0 && y ? x : undefined)(basename(filename).split("-")) - const description = README ? extract_description(README) : undefined + const description = README + ? extract_description(README) + : slug == 'pkgxdev/demo-test-pattern' + ? 'Prints a test pattern to your console' + : undefined const cmd = category ? `mash ${category} ${_stem.split('-').slice(1).join('-')}` : `mash ${fullname}` rv.push({ fullname, birthtime, description, avatar, url, category, README, cmd }) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18d23ea..2a73b1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,5 +8,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: pkgxdev/setup@v2 - - run: ./mash pkgxdev/demo - - run: ./mash pkgxdev/demo # check cache route works too + - run: ./mash demo test-pattern + - run: ./mash demo test-pattern # check cache route works too + - run: ./mash pkgxdev/demo-test-pattern # check fully qualified diff --git a/scripts/demo b/scripts/demo-test-pattern similarity index 92% rename from scripts/demo rename to scripts/demo-test-pattern index 7ea2c0f..32f1e92 100755 --- a/scripts/demo +++ b/scripts/demo-test-pattern @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env -S pkgx bash printf " " for b in 0 1 2 3 4 5 6 7; do printf " 4${b}m "; done echo