feat(cursor): automatically mark script files as execuable on save

This commit is contained in:
2025-02-23 16:37:15 +00:00
parent d76e2f771e
commit 1ef2937eb4
2 changed files with 18 additions and 1 deletions

View File

@@ -202,6 +202,7 @@
// ===========================================================================
// Ruby
// ===========================================================================
// Extensions:
// - https://marketplace.visualstudio.com/items?itemName=Shopify.ruby-extensions-pack
// - https://marketplace.visualstudio.com/items?itemName=connorshea.vscode-ruby-test-adapter
//
@@ -268,6 +269,21 @@
],
//
// ===========================================================================
// Run on Save callbacks
// ===========================================================================
// Extension URL:
// - https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave
//
"emeraldwalk.runonsave": {
"commands": [
{ // Automatically chmod +x script files (first two bytes are `#!`).
"match": ".*",
"cmd": "if [ ! -x \"${file}\" ] && head -n 1 \"${file}\" | grep -q '^#!'; then echo \"Marking ${relativeFile} as executable...\" && chmod +x \"${file}\"; fi"
}
]
},
//
// ===========================================================================
// Macros
// ===========================================================================
// Extension URL: