PT-BR:
Script em shell, destinado a automatizar comandos git para projetos da trybe.
Faça um clone do conteúdo desse repositório com um dos comandos abaixo:
git clone https://github.com/feliperaindo/sd-026-b-script-pull-request-trybe.gitou
git clone git@github.com:feliperaindo/sd-026-b-script-pull-request-trybe.gite siga os próximos passos.
EN-US:
Shell script, intended to automate git commands for trybe projects.
Clone this repository content with one of commands below:
git clone https://github.com/feliperaindo/sd-026-b-script-pull-request-trybe.gitor
git clone git@github.com:feliperaindo/sd-026-b-script-pull-request-trybe.gitand follow next steps.
MUITO IMPORTANTE: Para usar esse script é necessário a instalação do pacote
github clipara que o usuário possa usar comandosgh, necessário também que o usuário tenha um token pessoal do github.
-
➡️ Para instalação do
github cli, no Linux, acesse a página oficial com esse link e siga o tutorial de instação antes de continuar. -
➡️ Para instalação do
github cli, em outras plataformas, acesse a página oficial com esse link e siga o tutorial de instalação antes de continuar. -
➡️ Para criar um token pessoal do github, acesse pelo navegador sua página pessoal do github e siga a seguinte sequência de links no menu principal:
settings->developer settings->personal access tokensecreate a token.
Após a instalação do "github cli" e da criação do token pessoal do github abra o arquivo "script-to-pr.sh" em um editor de texto (VSCode, gedit, vim, nano, etc.).
-
Passo 1 🔽
Nas primeiras linhas do arquivo
script-to-pr.shencontre o textoTOKEN="personal token from github"e substitua o texto "personal token from github" pelo seu token pessoal do github. NÃO REMOVA AS ASPAS DUPLAS, APENAS SUBSTITUA O TEXTO. -
Passo 2 🔽
Nas primeiras linhas do arquivo
script-to-pr.shencontre o textoLOCAL_DIR="local directory you will choose"e modifique "local directory you will choose" pelo caminho completo do diretório a sua escolha. Esse diretório será usado para armazenar todos os repositórios que você clonar usando esse script. NÃO REMOVA AS ASPAS DUPLAS, APENAS SUBSTITUA O TEXTO. -
Passo 3 🔽
Nas primeiras linhas do arquivo
script-to-pr.shencontre o textoTEAM="inform your team"e modifique "inform your team" pela letra MINÚSCULA da sua turma. NÃO REMOVA AS ASPAS DUPLAS, APENAS SUBSTITUA O TEXTO. -
Passo 4 🔽
Para poder executar esse script no terminal é necessário executar manualmente o comando a seguir no terminal:
chmod u+x "local saved"/"file-name".
A referência
local savedé o caminho completo do diretório em que esse script esta salvo.
A referênciafile-nameé o nome do desse arquivo (por padrão o nome desse aquivo éscript-to-pr.sh). Se o nome foi alterado, use o nome atual do arquivo/script.
👀 RECOMENDADO 👀 : Antes de usar esse script pela primeira vez, leia o código para entender o que cada linha de código faz, e se necessário faça as alterações que achar pertinente.
Abra o seu terminal e digite o seguinte comando "path/script-to-pr.sh https://github.com/... fistName lastName" e o script se encarregará de fazer todo o trabalho.
Exemplo: caso eu queira fazer o clone desse repositório e abrir um Pull Request eu rodaria o seguinte comando no terminal da minha máquina
~/script-to-pr.sh https://github.com/feliperaindo/sd-026-b-script-pull-request-trybe felipe carvalho.Note que o
path/é representado pelo~/o que representa a minha pastahome/na raiz do meu sistema. Que é onde o arquivo está salvo.O
script-to-pr.shé a chamada do meu script.A URL
https://github.com/feliperaindo/sd-026-b-script-pull-request-trybeé a identificação do repositório github que quero clonar.E por fim, a parte final, que inclui os dois argumentos
felipeecarvalhosão respectivamente os parâmetrosfirstNameelastNamedescritos no código do script.
VERY IMPORTANT: To use this script you have to install
github clito useghcommands, and have a github personal token.
-
➡️ To install
github cli, on linux, access official webpage with this link and follow tutorial installation before continuing. -
➡️ To install
github cli, on another platform, access official webpage with this link and follow tutorial installation before continuing. -
➡️ To create a github personal token access your github account webpage and folow this menu links:
settings->developer settings->personal access tokensandcreate a token.
After install "github cli" and create a github personal token pessoal open the file "script-to-pr.sh" in a text editor (VSCode, gedit, vim, nano, etc.).
-
Step 1
▶️ In the first lines from filescript-to-pr.shfoud the textTOKEN="personal token from github"and substitute "personal token from github" for your personal github token. DO NOT REMOVE QUOTATION MARKS, JUST SUBSTITUTE THE TEXT INSIDE. -
Step 2
▶️ In the first lines from filescript-to-pr.shfoud the textLOCAL_DIR="local directory you will choose"and substitute "local directory you will choose" for a entire path directory you choose. This directory will be use to storage all repositories you will clone using this script. DO NOT REMOVE QUOTATION MARKS, JUST SUBSTITUTE THE TEXT INSIDE. -
Step 3
▶️ In the first lines from filescript-to-pr.shfoud the textTEAM="inform your team"and substitute "inform your team" for the letter in LOWER CASE of your team. DO NOT REMOVE QUOTATION MARKS, JUST SUBSTITUTE THE TEXT INSIDE. -
Step 4
▶️ To execute this file as a script in your terminal, you need to run manually in terminal the commandchmod u+x "local saved"/"file-name".
The reference
local savedis the entire path of directory you saved this file.
The referencefile-nameis the name you have for this file (as default it name isscript-to-pr). If you change it's name or download it with another name, use file actual name.
👀 RECOMENDED 👀 : Before use this script at the first time, read entire code to understand what even part of this code do, and make some changes if you need or want.
Open terminal and type the follow command "path/script-to-pr.sh https://github.com/... fistName lastName" and the script will be sure to do all of work.
Example: if I want to clone this repository and open a Pull Request I run the follow command in my computer terminal
~/script-to-pr.sh https://github.com/feliperaindo/sd-026-b-script-pull-request-trybe felipe carvalho.Note that the
path/is represented by~/that represents my directoryhome/on system root. Where this file is stored.The
script-to-pr.shis called by this part of command.The URL
https://github.com/feliperaindo/sd-026-b-script-pull-request-trybeis the github repository identification who I want to clone.At a final two arguments
felipeecarvalhothey are the parametersfirstNameandlastNamedescribed in script code.