mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 20:25:30 +00:00
feat: add Dotbot
This commit is contained in:
7
config/fish/functions/dataUrl.fish
Normal file
7
config/fish/functions/dataUrl.fish
Normal file
@@ -0,0 +1,7 @@
|
||||
function dataUrl --description "Create a data URL from a file"
|
||||
set mimeType (file -b --mime-type $argv)
|
||||
if string match -r '^text/' $mimeType
|
||||
set mimeType "$mimeType;charset=utf-8"
|
||||
end
|
||||
echo "data:$mimeType;base64,(openssl base64 -in $argv | tr -d '\n')"
|
||||
end
|
||||
Reference in New Issue
Block a user