{
"$type": "site.standard.document",
"canonicalUrl": "https://rednafi.com/misc/do-not-add-extensions-to-bash-executables/",
"description": "Why executable scripts shouldn't have extensions. Learn GitHub's scripts-to-rule-them-all pattern for language-agnostic project automation.",
"path": "/misc/do-not-add-extensions-to-bash-executables/",
"publishedAt": "2021-11-23T00:00:00.000Z",
"site": "at://did:plc:fgtm2c26vfcj74rfmeggbyqj/site.standard.publication/3mnl6f7ob462z",
"tags": [
"Shell",
"Unix",
"TIL",
"CLI"
],
"textContent": "I was browsing through the source code of Tom Christie's [typesystem] library and discovered\nthat the [shell scripts] of the project don't have any extensions attached to them. At\nfirst, I found it odd, and then it all started to make sense.\n\n> Executable scripts can be written in any language and the users don't need to care about\n> that.\n\nGitHub uses this [scripts-to-rule-them-all pattern] successfully to normalize their scripts.\nAccording to the pattern, every project should have a folder named scripts with a subset\nor superset of the following files:\n\n- script/bootstrap – installs/updates all dependencies\n- script/setup – sets up a project to be used for the first time\n- script/update – updates a project to run at its current version\n- script/server – starts app\n- script/test – runs tests\n- script/cibuild – invoked by continuous integration servers to run tests\n- script/console – opens a console\n\n\n\n\n[typesystem]:\n https://github.com/encode/typesystem\n\n[shell scripts]:\n https://github.com/encode/typesystem/tree/master/scripts\n\n[scripts-to-rule-them-all pattern]:\n https://github.com/github/scripts-to-rule-them-all",
"title": "Don't add extensions to shell executables"
}