"use strict";(self.webpackChunkgoffee_site=self.webpackChunkgoffee_site||[]).push([[6803],{3668:(e,o,t)=>{t.r(o),t.d(o,{assets:()=>c,contentTitle:()=>r,default:()=>h,frontMatter:()=>l,metadata:()=>s,toc:()=>a});var n=t(4848),i=t(8453);const l={title:"Installation"},r=void 0,s={id:"installation",title:"Installation",description:"To create a new Goffee project you need to install goffee first which is the cli tool",source:"@site/docs/installation.md",sourceDirName:".",slug:"/installation",permalink:"/goffee/docs/installation",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{title:"Installation"},sidebar:"docsSidebar",previous:{title:"Goffee Docs",permalink:"/goffee/docs/category/goffee-docs"},next:{title:"Getting Started",permalink:"/goffee/docs/getting-started"}},c={},a=[{value:"Install Goffee cli",id:"install-goffee-cli",level:4},{value:"Set up your GOPATH",id:"set-up-your-gopath",level:5},{value:"Get the Goffee command line tool",id:"get-the-goffee-command-line-tool",level:4},{value:"Create a new project:",id:"create-a-new-project",level:4}];function d(e){const o={code:"code",em:"em",h4:"h4",h5:"h5",li:"li",ol:"ol",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(o.p,{children:["To create a new Goffee project you need to install ",(0,n.jsx)(o.code,{children:"goffee"})," first which is the ",(0,n.jsx)(o.code,{children:"cli tool"})]}),"\n",(0,n.jsx)(o.h4,{id:"install-goffee-cli",children:"Install Goffee cli"}),"\n",(0,n.jsx)(o.h5,{id:"set-up-your-gopath",children:"Set up your GOPATH"}),"\n",(0,n.jsxs)(o.p,{children:["If you have not created a GOPATH as part of the installation, do so now. The ",(0,n.jsx)(o.code,{children:"GOPATH"}),"\nis a directory where all of your Go code will live. Here is one way of setting it up:"]}),"\n",(0,n.jsxs)(o.ol,{children:["\n",(0,n.jsxs)(o.li,{children:["Make a directory: ",(0,n.jsx)(o.code,{children:"mkdir ~/goffee"})]}),"\n",(0,n.jsxs)(o.li,{children:["Tell Go to use that as your GOPATH: ",(0,n.jsx)(o.code,{children:"export GOPATH=~/goffee"})]}),"\n",(0,n.jsxs)(o.li,{children:["Save your GOPATH so that it will apply to all future shell sessions: ",(0,n.jsx)(o.code,{children:"echo export GOPATH=$GOPATH >> ~/.bash_profile"})]}),"\n"]}),"\n",(0,n.jsxs)(o.p,{children:["Note that depending on your shell, you may need to adjust to write the export into a different configuration file (e.g. ",(0,n.jsx)(o.em,{children:"~/.bashrc"}),", *~/.zshrc, etc.)."]}),"\n",(0,n.jsx)(o.h4,{id:"get-the-goffee-command-line-tool",children:"Get the Goffee command line tool"}),"\n",(0,n.jsxs)(o.p,{children:["To install the ",(0,n.jsx)(o.code,{children:"goffee"})," globally open up your terminal and run the following command:"]}),"\n",(0,n.jsx)(o.pre,{children:(0,n.jsx)(o.code,{className:"language-bash",children:"go install git.smarteching.com/goffee/goffee@latest\n"})}),"\n",(0,n.jsxs)(o.p,{children:["Ensure the ",(0,n.jsx)(o.code,{children:"$GOPATH/bin"})," directory is in your PATH so that you can reference the command from anywhere."]}),"\n",(0,n.jsx)(o.p,{children:'export PATH="$PATH:$GOPATH/bin"'}),"\n",(0,n.jsx)(o.h4,{id:"create-a-new-project",children:"Create a new project:"}),"\n",(0,n.jsx)(o.p,{children:"The command for creating a new project is the following:"}),"\n",(0,n.jsx)(o.pre,{children:(0,n.jsx)(o.code,{className:"language-bash",children:"goffee new [project-name] [project-remote-repository]\n"})}),"\n",(0,n.jsx)(o.p,{children:"Example"}),"\n",(0,n.jsx)(o.pre,{children:(0,n.jsx)(o.code,{className:"language-bash",children:"goffee new myapp git.smarteching.com/goffee/myapp\n"})}),"\n",(0,n.jsxs)(o.p,{children:["where:\n",(0,n.jsx)(o.code,{children:"project-name"})," is the name of your project\n",(0,n.jsx)(o.code,{children:"remote-repository"})," is the remote repository that will host the project."]})]})}function h(e={}){const{wrapper:o}={...(0,i.R)(),...e.components};return o?(0,n.jsx)(o,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},8453:(e,o,t)=>{t.d(o,{R:()=>r,x:()=>s});var n=t(6540);const i={},l=n.createContext(i);function r(e){const o=n.useContext(l);return n.useMemo((function(){return"function"==typeof e?e(o):{...o,...e}}),[o,e])}function s(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),n.createElement(l.Provider,{value:o},e.children)}}}]);