Cleanup some inconsistencies and improve collapse some functionality

This commit is contained in:
Tyler McGoffin 2024-10-17 13:36:19 -07:00
parent 95ed11d9ba
commit e7549c93f9
9 changed files with 17 additions and 26 deletions

View file

@ -23,4 +23,4 @@ exec gh repo unarchive $ORG/$SCRIPT_NAME-$RANDOM_STRING --yes
# Check that the repo is unarchived
exec gh repo view $ORG/$SCRIPT_NAME-$RANDOM_STRING --json=isArchived --jq='.isArchived'
stdout false
stdout false

View file

@ -12,4 +12,4 @@ exec gh repo clone $ORG/$SCRIPT_NAME-$RANDOM_STRING
# Ensure the repo was cloned
exec ls $SCRIPT_NAME-$RANDOM_STRING
stdout README.md
stdout README.md

View file

@ -8,5 +8,5 @@ exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --add-readme --private
defer gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING
# Check that the repo exists
exec gh repo view $ORG/$SCRIPT_NAME-$RANDOM_STRING --json name --jq '.name'
stdout $SCRIPT_NAME-$RANDOM_STRING
exec gh repo view $ORG/$SCRIPT_NAME-$RANDOM_STRING --json=name --jq='.name'
stdout $SCRIPT_NAME-$RANDOM_STRING

View file

@ -13,4 +13,4 @@ exec gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING
# Ensure that the repo was deleted
! exec gh repo view $ORG/$SCRIPT_NAME-$RANDOM_STRING --json name --jq '.name'
stderr 'Could not resolve to a Repository with the name'
stderr 'Could not resolve to a Repository with the name'

View file

@ -32,4 +32,3 @@ exec gh repo deploy-key list --json=id --jq='.[].id'
-- deployKey.pub --
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAZmdeRNskfpvYL5YHB/YJaW8hTEXpnvPMkx5Ri+YwUr myTitle

View file

@ -9,11 +9,11 @@ defer gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING
# Check that the repo description is empty
exec gh repo view $ORG/$SCRIPT_NAME-$RANDOM_STRING --json description --jq '.description'
stdout ''
! stdout '.'
# Edit the repo description
exec gh repo edit $ORG/$SCRIPT_NAME-$RANDOM_STRING --description 'newDescription'
# Check that the repo description is updated
exec gh repo view $ORG/$SCRIPT_NAME-$RANDOM_STRING --json description --jq '.description'
stdout 'newDescription'
stdout 'newDescription'

View file

@ -41,4 +41,4 @@ exec ls
stdout asset.txt
-- asset.txt --
Hello, world!
Hello, world!

View file

@ -5,20 +5,15 @@ exec gh auth setup-git
exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --add-readme --private
# List the repos and check for the new repo
exec gh repo list $ORG --json name --jq '.[].name'
exec gh repo list $ORG --json=name --jq='.[].name'
stdout $SCRIPT_NAME-$RANDOM_STRING
# Rename the repo
exec gh repo rename $SCRIPT_NAME-$RANDOM_STRING-renamed --repo=$ORG/$SCRIPT_NAME-$RANDOM_STRING --yes
# Defer repo deletion
defer gh repo delete $ORG/$SCRIPT_NAME-$RANDOM_STRING-renamed --yes
# List the repos and check for the renamed repo
exec gh repo list $ORG --json name --jq '.[].name'
exec gh repo list $ORG --json=name --jq='.[].name'
stdout $SCRIPT_NAME-$RANDOM_STRING-renamed
# Delete the renamed repo
exec gh repo delete $ORG/$SCRIPT_NAME-$RANDOM_STRING-renamed --yes
# List the repos and check for the deleted repo
exec gh repo list $ORG --json name --jq '.[].name'
! stdout $SCRIPT_NAME-$RANDOM_STRING-renamed

View file

@ -1,17 +1,14 @@
# Use gh as a credential helper
exec gh auth setup-git
# Create a repository with a file so it has a default branch
exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --add-readme --private
# Create and clone a repository with a file so it has a default branch
exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --add-readme --private --clone
# Defer repo cleanup
defer gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING
# Clone the repo
exec gh repo clone $ORG/$SCRIPT_NAME-$RANDOM_STRING
cd $SCRIPT_NAME-$RANDOM_STRING
# Ensure that no default is set
cd $SCRIPT_NAME-$RANDOM_STRING
exec gh repo set-default --view
stderr 'no default repository has been set; use `gh repo set-default` to select one'
@ -20,4 +17,4 @@ exec gh repo set-default $ORG/$SCRIPT_NAME-$RANDOM_STRING
# Check that the default is set
exec gh repo set-default --view
stdout $ORG/$SCRIPT_NAME-$RANDOM_STRING
stdout $ORG/$SCRIPT_NAME-$RANDOM_STRING