Created
February 12, 2023 22:21
-
-
Save billwanjohi/9df67ed343e17611c0b928c4bc92718d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euxo pipefail | |
BW_FOLDER=$(bw list folders | jq -rc ".[] | select(.name == \"$MY_FOLDER_NAME\") | .id") | |
BW_ITEMS=$(bw list items --folderid $BW_FOLDER | jq -rc '.[] | select(.organizationId == null) | .id') | |
BW_ORGANIZATION=$(bw list organizations --search $MY_ORG_NAME | jq -rc '.[].id') | |
BW_COLLECTIONS=$(bw list collections --search $MY_COLLECTION_NAME --organizationid=$BW_ORGANIZATION | jq -c '.[].id' | jq -s | bw encode) | |
echo $BW_ITEMS | xargs --replace={} bw move {} $BW_ORGANIZATION $BW_COLLECTIONS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment