Skip to content

Commit b8bca87

Browse files
authored
Merge pull request #2 from kindlyops/elliot/readme
2 parents cff9827 + 447b247 commit b8bca87

3 files changed

Lines changed: 46 additions & 49 deletions

File tree

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
# branches to consider in the event; optional, defaults to all
66
branches:
7-
- master
7+
- main
88

99
jobs:
1010
update_draft_release:

README.md

Lines changed: 9 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@
22

33
## Chapters
44

5-
Generate OBS scenes from chapter markers for easier setup of run lists.# deleterious
6-
Helps you clean up AWS resources. This is handy when
7-
retention policies on CloudFormation stacks leave lots
8-
of orphaned AWS resources around costing money.
5+
Generate OBS scenes from chapter markers for easier setup of run lists.
96

107
## installation for homebrew (MacOS/Linux)
118

12-
brew install kindlyops/tap/deleterious
9+
brew install kindlyops/tap/vbs
1310

1411
once installed, you can upgrade to a newer version using this command:
1512

16-
brew upgrade kindlyops/tap/deleterious
13+
brew upgrade kindlyops/tap/vbs
1714

1815
## installation for scoop (Windows Powershell)
1916

@@ -23,56 +20,22 @@ To enable the bucket for your scoop installation
2320

2421
To install deleterious
2522

26-
scoop install deleterious
23+
scoop install vbs
2724

2825
once installed, you can upgrade to a newer version using this command:
2926

3027
scoop status
31-
scoop update deleterious
28+
scoop update vbs
3229

3330
## installation from source
3431

35-
go get github.com/kindlyops/deleterious
36-
deleterious help
32+
go get github.com/kindlyops/vbs
33+
vbs help
3734

38-
## Example of deleting DynamoDB tables
39-
40-
Once deleterious gives you a list of things to delete, and
41-
you have manually confirmed they are ok to delete, you
42-
can make a little loop to delete the objects. Here is an example with dynamoDB tables
43-
44-
```bash
45-
#!/bin/bash
46-
47-
# tables that need to be deleted
48-
declare -a tables=("foo-MonkeyTable-1FDTVGZJOT25Y"
49-
"foo-BananaTable-1HFLQZL7CVQ7L"
50-
)
51-
52-
for i in "${tables[@]}"; do
53-
echo "deleting table: $i"
54-
aws dynamodb delete-table --table-name "$i"
55-
done
56-
```
57-
58-
## Example of deleting S3 buckets
59-
60-
Once deleterious gives you a list of things to delete, and
61-
you have manually confirmed they are ok to delete, you
62-
can make a little loop to delete the objects. Here is an example with S3 buckets
35+
## Example of listing chapters from video file
6336

6437
```bash
65-
#!/bin/bash
66-
67-
# buckets that need to be deleted
68-
declare -a buckets=("foo-bananabucket-148lv5q85e3dc"
69-
"foo-bananabucket-14bh2oapj6a3e"
70-
)
71-
72-
for i in "${buckets[@]}"; do
73-
echo "deleting bucket: $i"
74-
aws s3api delete-bucket --bucket "$i"
75-
done
38+
vbs chapterlist file.mp4
7639
```
7740

7841
## Testing release process

cmd/chapters.go

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
package cmd
1616

1717
import (
18-
"fmt"
18+
"log"
19+
"os"
20+
"os/exec"
1921

2022
"github.com/spf13/cobra"
2123
)
@@ -31,7 +33,39 @@ var chapterListCmd = &cobra.Command{
3133

3234
func chapterList(cmd *cobra.Command, args []string) {
3335

34-
fmt.Printf("This is chapterlist")
36+
_, err := exec.LookPath("ffprobe")
37+
38+
if err != nil {
39+
log.Fatal("Could not find ffprobe. Please install ffmpeg and ffprobe.")
40+
}
41+
42+
_, err = exec.LookPath("ffmpeg")
43+
44+
if err != nil {
45+
log.Fatal("Could not find ffmpeg. Please install ffmpeg.")
46+
}
47+
48+
_, err = exec.LookPath("jq")
49+
50+
if err != nil {
51+
log.Fatal("Could not find jq. Please install jq.")
52+
}
53+
54+
target := args[0]
55+
_, err = os.Stat(target)
56+
57+
if err != nil {
58+
log.Fatal("Could not access video container ", target)
59+
}
60+
61+
command := exec.Command("ffprobe",
62+
"-print_format", "json",
63+
"-loglevel", "error",
64+
"-show_chapters",
65+
"-i", target)
66+
67+
output, _ := command.Output()
68+
_, _ = os.Stdout.Write(output)
3569
}
3670

3771
func init() {

0 commit comments

Comments
 (0)