Unverified Commit cf0b1d94 authored by Maxi Gimenez's avatar Maxi Gimenez Committed by GitHub

chore(create-next-app): add missing return types on helpers (#12616)

Co-authored-by: 's avatarTim Neutkens <tim@timneutkens.nl>
parent 61599b85
......@@ -12,7 +12,7 @@ export type RepoInfo = {
filePath: string
}
export async function isUrlOk(url: string) {
export async function isUrlOk(url: string): Promise<boolean> {
const res = await got(url).catch(e => e)
return res.statusCode === 200
}
......
......@@ -2,7 +2,7 @@ import { execSync } from 'child_process'
import path from 'path'
import rimraf from 'rimraf'
function isInGitRepository() {
function isInGitRepository(): boolean {
try {
execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore' })
return true
......@@ -10,7 +10,7 @@ function isInGitRepository() {
return false
}
function isInMercurialRepository() {
function isInMercurialRepository(): boolean {
try {
execSync('hg --cwd . root', { stdio: 'ignore' })
return true
......@@ -18,7 +18,7 @@ function isInMercurialRepository() {
return false
}
export function tryGitInit(root: string) {
export function tryGitInit(root: string): boolean {
let didInit = false
try {
execSync('git --version', { stdio: 'ignore' })
......
......@@ -2,7 +2,7 @@ import chalk from 'chalk'
import fs from 'fs'
import path from 'path'
export function isFolderEmpty(root: string, name: string) {
export function isFolderEmpty(root: string, name: string): boolean {
const validFiles = [
'.DS_Store',
'.git',
......
import { execSync } from 'child_process'
export function shouldUseYarn() {
export function shouldUseYarn(): boolean {
try {
const userAgent = process.env.npm_config_user_agent
if (userAgent) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment