Skip to content

Commit

Permalink
Rename download_repo_with_api to get_files_with_github_api
Browse files Browse the repository at this point in the history
  • Loading branch information
MSE99 committed Nov 8, 2023
1 parent 30b0e29 commit 1b6f785
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { command_on_system } from './exec.js'

const repo_name_to_api_link = (repo_name) => `https://api.github.com/repos/${repo_name}`

async function downloadRepo(repo_name, branch, github_personal_access_token, new_project_path) {
const download_repo_files = async (repo_name, branch, github_personal_access_token, new_project_path) => {
const loadingSpinner = ora()
loadingSpinner.start()

Expand Down Expand Up @@ -99,7 +99,7 @@ async function downloadRepo(repo_name, branch, github_personal_access_token, new
}
}

export async function download_repo_with_api(repo_name, branch, new_project_path) {
export const get_files_with_github_api = async (repo_name, branch, new_project_path) => {
if (!command_on_system('tar')) {
Logger.fatal('please install "tar" extraction command line')
}
Expand Down Expand Up @@ -142,5 +142,5 @@ export async function download_repo_with_api(repo_name, branch, new_project_path
}
}

await downloadRepo(repo_name, branch, github_personal_access_token, new_project_path)
await download_repo_files(repo_name, branch, github_personal_access_token, new_project_path)
}
4 changes: 2 additions & 2 deletions src/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs from 'fs'
import Logger from './logger.js'

import { is_git_installed_on_system, is_repo_reachable_by_cli, get_files_with_git_cli } from './git.js'
import { download_repo_with_api } from './github.js'
import { get_files_with_github_api } from './github.js'
import { read_answer_to, read_choice } from './prompt.js'

const read_project_path = async () => {
Expand Down Expand Up @@ -56,7 +56,7 @@ export const create_rest = async (tar = false) => {
if (tar === false && is_git_installed_on_system() && is_repo_reachable_by_cli(repo_name)) {
await get_files_with_git_cli(repo_name, branch, new_project_path)
} else {
await download_repo_with_api(repo_name, branch, new_project_path)
await get_files_with_github_api(repo_name, branch, new_project_path)
}

Logger.success(
Expand Down

0 comments on commit 1b6f785

Please sign in to comment.