This file contains hidden or 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
import { PutObjectCommand, S3Client } from '@aws-sdk/client-s3'; | |
const s3AccessKeyId = "Y64W56U7IE85W46JH"; // Generate key at https://cloud.digitalocean.com/account/api/tokens | |
const s3SecretAccessKey = "y546wu7ie5u435y/7uei564sy5u6w57"; | |
const s3Bucket = "foo"; // Assumes your Space is https://cloud.digitalocean.com/spaces/foo | |
const s3Region = "nyc3"; // Get this from "Endpoint" at https://cloud.digitalocean.com/spaces/foo/settings | |
const s3Endpoint = "https://nyc3.digitaloceanspaces.com"; // From "Endpoint" at https://cloud.digitalocean.com/spaces/foo/settings, prepend 'https://' | |
const s3Client = new S3Client({ |
This file contains hidden or 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
rename() { | |
[ "$#" -ne 1 ] && echo "Usage: rename <file_path>" && return 1 | |
local temp_file=$(mktemp) | |
echo "$1" > "$temp_file" | |
"${EDITOR:-vi}" "$temp_file" | |
local new_path=$(cat "$temp_file") | |
mv "$1" "$new_path" | |
echo "$new_path" | |
rm "$temp_file" | |
} |
OlderNewer