Skip to content

Commit

Permalink
Switch to new μpkg package format
Browse files Browse the repository at this point in the history
  • Loading branch information
andsens committed May 17, 2024
1 parent 0ecaf1e commit b919251
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 7 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Lint

on:
push:
branches: ['*']
tags: ['!v*']
workflow_call: {}

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
env:
SHELLCHECK_OPTS: -x
20 changes: 20 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Release

on:
push:
tags: ['v*']

jobs:
lint:
uses: ./.github/workflows/lint.yaml
secrets: inherit
release:
needs: [lint]
permissions:
contents: write
runs-on: ubuntu-latest
name: Create GitHub release
steps:
- uses: orbit-online/upkg-release@v1
with:
paths: collections.sh LICENSE README.md
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Orbit Online A/S

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

Functions for handling bash arrays

## `contains_elements(element, ...array)`
## Installation

Checks if an element is in an array
See [the latest release](https://github.com/orbit-online/collections.sh/releases/latest) for instructions.

## Usage

### Usage
### `contains_elements(element, ...array)`

Checks if an element is in an array

```
local arr=(1 "a b" 2)
Expand All @@ -17,12 +21,10 @@ else
fi
```

## `join_by(separator, ...array)`
### `join_by(separator, ...array)`

Joins all elements in the array into a single string using `separator`

### Usage

```
local arr=(1 "a b" 2)
printf "arr joined with - is '%s'" "$(join_by - "${arr[@]}")"
Expand Down
3 changes: 2 additions & 1 deletion upkg.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"assets": ["collections.sh"]
"$schema": "https://schemas.orbit.dev/upkg/upkg-v0.22.0.schema.json",
"name": "collections.sh"
}

0 comments on commit b919251

Please sign in to comment.