mirror of
https://github.com/go-task/task.git
synced 2025-04-11 11:41:56 +02:00
1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
"use strict";(self.webpackChunktaskfile_dev=self.webpackChunktaskfile_dev||[]).push([[217],{3905:function(e,t,a){a.d(t,{Zo:function(){return c},kt:function(){return d}});var n=a(7294);function o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?r(Object(a),!0).forEach((function(t){o(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):r(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function l(e,t){if(null==e)return{};var a,n,o=function(e,t){if(null==e)return{};var a,n,o={},r=Object.keys(e);for(n=0;n<r.length;n++)a=r[n],t.indexOf(a)>=0||(o[a]=e[a]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(o[a]=e[a])}return o}var s=n.createContext({}),p=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},c=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var a=e.components,o=e.mdxType,r=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),m=p(a),d=o,k=m["".concat(s,".").concat(d)]||m[d]||u[d]||r;return a?n.createElement(k,i(i({ref:t},c),{},{components:a})):n.createElement(k,i({ref:t},c))}));function d(e,t){var a=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=a.length,i=new Array(r);i[0]=m;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:o,i[1]=l;for(var p=2;p<r;p++)i[p]=a[p];return n.createElement.apply(null,i)}return n.createElement.apply(null,a)}m.displayName="MDXCreateElement"},9250:function(e,t,a){a.r(t),a.d(t,{assets:function(){return c},contentTitle:function(){return s},default:function(){return d},frontMatter:function(){return l},metadata:function(){return p},toc:function(){return u}});var n=a(7462),o=a(3366),r=(a(7294),a(3905)),i=["components"],l={slug:"/installation/",sidebar_position:2},s="Installation",p={unversionedId:"installation",id:"installation",title:"Installation",description:"Task offers many installation methods. Check out the available methods below.",source:"@site/docs/installation.md",sourceDirName:".",slug:"/installation/",permalink:"/installation/",draft:!1,tags:[],version:"current",sidebarPosition:2,frontMatter:{slug:"/installation/",sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Home",permalink:"/"},next:{title:"Usage",permalink:"/usage/"}},c={},u=[{value:"Package Managers",id:"package-managers",level:2},{value:"<strong>Homebrew</strong>",id:"homebrew",level:3},{value:"<strong>Snap</strong>",id:"snap",level:3},{value:"<strong>Chocolatey</strong>",id:"chocolatey",level:3},{value:"<strong>Scoop</strong>",id:"scoop",level:3},{value:"<strong>AUR</strong>",id:"aur",level:3},{value:"<strong>Nix</strong>",id:"nix",level:3},{value:"Get The Binary",id:"get-the-binary",level:2},{value:"<strong>Binary</strong>",id:"binary",level:3},{value:"<strong>Install Script</strong>",id:"install-script",level:3},{value:"<strong>GitHub Actions</strong>",id:"github-actions",level:3},{value:"Build From Source",id:"build-from-source",level:2},{value:"<strong>Go Modules</strong>",id:"go-modules",level:3}],m={toc:u};function d(e){var t=e.components,a=(0,o.Z)(e,i);return(0,r.kt)("wrapper",(0,n.Z)({},m,a,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"installation"},"Installation"),(0,r.kt)("p",null,"Task offers many installation methods. Check out the available methods below."),(0,r.kt)("h2",{id:"package-managers"},"Package Managers"),(0,r.kt)("h3",{id:"homebrew"},(0,r.kt)("strong",{parentName:"h3"},"Homebrew")),(0,r.kt)("p",null,"If you're on macOS or Linux and have ",(0,r.kt)("a",{parentName:"p",href:"https://brew.sh/"},"Homebrew")," installed, getting\nTask is as simple as running:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"brew install go-task/tap/go-task\n")),(0,r.kt)("h3",{id:"snap"},(0,r.kt)("strong",{parentName:"h3"},"Snap")),(0,r.kt)("p",null,"Task is available in ",(0,r.kt)("a",{parentName:"p",href:"https://snapcraft.io/task"},"Snapcraft"),", but keep in mind that your\nLinux distribution should allow classic confinement for Snaps to Task work\nright:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"sudo snap install task --classic\n")),(0,r.kt)("h3",{id:"chocolatey"},(0,r.kt)("strong",{parentName:"h3"},"Chocolatey")),(0,r.kt)("p",null,"If you're on Windows and have ",(0,r.kt)("a",{parentName:"p",href:"https://chocolatey.org/"},"Chocolatey")," installed, getting\nTask is as simple as running:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"choco install go-task\n")),(0,r.kt)("p",null,"This installation method is community owned."),(0,r.kt)("h3",{id:"scoop"},(0,r.kt)("strong",{parentName:"h3"},"Scoop")),(0,r.kt)("p",null,"If you're on Windows and have ",(0,r.kt)("a",{parentName:"p",href:"https://scoop.sh/"},"Scoop")," installed, use ",(0,r.kt)("inlineCode",{parentName:"p"},"extras")," bucket\nto install Task like:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-cmd"},"scoop bucket add extras\nscoop install task\n")),(0,r.kt)("p",null,"This installation method is community owned. After a new release of Task, it\nmay take some time until it's available on Scoop."),(0,r.kt)("h3",{id:"aur"},(0,r.kt)("strong",{parentName:"h3"},"AUR")),(0,r.kt)("p",null,"If you're on Arch Linux you can install Task from\n",(0,r.kt)("a",{parentName:"p",href:"https://aur.archlinux.org/packages/taskfile-git"},"AUR")," using your favorite\npackage manager such as ",(0,r.kt)("inlineCode",{parentName:"p"},"yay"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"pacaur")," or ",(0,r.kt)("inlineCode",{parentName:"p"},"yaourt"),":"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-cmd"},"yay -S taskfile-git\n")),(0,r.kt)("p",null,"This installation method is community owned, but since it's ",(0,r.kt)("inlineCode",{parentName:"p"},"-git")," version of\nthe package, it's always latest available version based on the Git repository."),(0,r.kt)("h3",{id:"nix"},(0,r.kt)("strong",{parentName:"h3"},"Nix")),(0,r.kt)("p",null,"If you're on NixOS or have Nix installed\nyou can install Task from ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/NixOS/nixpkgs"},"nixpkgs"),":"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-cmd"},"nix-env -iA nixpkgs.go-task\n")),(0,r.kt)("p",null,"This installation method is community owned. After a new release of Task, it\nmay take some time until it's available in ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/NixOS/nixpkgs"},"nixpkgs"),"."),(0,r.kt)("h2",{id:"get-the-binary"},"Get The Binary"),(0,r.kt)("h3",{id:"binary"},(0,r.kt)("strong",{parentName:"h3"},"Binary")),(0,r.kt)("p",null,"You can download the binary from the ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/go-task/task/releases"},"releases page on GitHub")," and\nadd to your ",(0,r.kt)("inlineCode",{parentName:"p"},"$PATH"),"."),(0,r.kt)("p",null,"DEB and RPM packages are also available."),(0,r.kt)("p",null,"The ",(0,r.kt)("inlineCode",{parentName:"p"},"task_checksums.txt")," file contains the SHA-256 checksum for each file."),(0,r.kt)("h3",{id:"install-script"},(0,r.kt)("strong",{parentName:"h3"},"Install Script")),(0,r.kt)("p",null,"We also have an ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/go-task/task/blob/master/install-task.sh"},"install script")," which is very useful in\nscenarios like CI. Many thanks to ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/goreleaser/godownloader"},"GoDownloader")," for enabling the\neasy generation of this script."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},'# For Default Installation to ./bin with debug logging\nsh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d\n\n# For Installation To /usr/local/bin for userwide access with debug logging\n# May require sudo sh\nsh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin\n\n')),(0,r.kt)("div",{className:"admonition admonition-info alert alert--info"},(0,r.kt)("div",{parentName:"div",className:"admonition-heading"},(0,r.kt)("h5",{parentName:"div"},(0,r.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,r.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,r.kt)("path",{parentName:"svg",fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"}))),"info")),(0,r.kt)("div",{parentName:"div",className:"admonition-content"},(0,r.kt)("p",{parentName:"div"},"This method will download the binary on the local ",(0,r.kt)("inlineCode",{parentName:"p"},"./bin")," directory by default."))),(0,r.kt)("h3",{id:"github-actions"},(0,r.kt)("strong",{parentName:"h3"},"GitHub Actions")),(0,r.kt)("p",null,"If you want to install Task in GitHub Actions you can try using\n",(0,r.kt)("a",{parentName:"p",href:"https://github.com/arduino/setup-task"},"this action"),"\nby the Arduino team:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},"- name: Install Task\n uses: arduino/setup-task@v1\n")),(0,r.kt)("p",null,"This installation method is community owned."),(0,r.kt)("h2",{id:"build-from-source"},"Build From Source"),(0,r.kt)("h3",{id:"go-modules"},(0,r.kt)("strong",{parentName:"h3"},"Go Modules")),(0,r.kt)("p",null,"First, make sure you have ",(0,r.kt)("a",{parentName:"p",href:"https://golang.org/"},"Go")," properly installed and setup."),(0,r.kt)("p",null,"You can easily install the latest release globally by running:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"go install github.com/go-task/task/v3/cmd/task@latest\n")),(0,r.kt)("p",null,"Or you can install into another directory:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"env GOBIN=/bin go install github.com/go-task/task/v3/cmd/task@latest\n")),(0,r.kt)("p",null,"If using Go 1.15 or earlier, instead use:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"env GO111MODULE=on go get -u github.com/go-task/task/v3/cmd/task@latest\n")),(0,r.kt)("div",{className:"admonition admonition-tip alert alert--success"},(0,r.kt)("div",{parentName:"div",className:"admonition-heading"},(0,r.kt)("h5",{parentName:"div"},(0,r.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,r.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"},(0,r.kt)("path",{parentName:"svg",fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"}))),"tip")),(0,r.kt)("div",{parentName:"div",className:"admonition-content"},(0,r.kt)("p",{parentName:"div"},"For CI environments we recommend using the ",(0,r.kt)("a",{parentName:"p",href:"#get-the-binary"},"install script"),"\ninstead, which is faster and more stable, since it'll just download the latest\nreleased binary."))))}d.isMDXComponent=!0}}]); |