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 = { ...@@ -12,7 +12,7 @@ export type RepoInfo = {
filePath: string filePath: string
} }
export async function isUrlOk(url: string) { export async function isUrlOk(url: string): Promise<boolean> {
const res = await got(url).catch(e => e) const res = await got(url).catch(e => e)
return res.statusCode === 200 return res.statusCode === 200
} }
......
...@@ -2,7 +2,7 @@ import { execSync } from 'child_process' ...@@ -2,7 +2,7 @@ import { execSync } from 'child_process'
import path from 'path' import path from 'path'
import rimraf from 'rimraf' import rimraf from 'rimraf'
function isInGitRepository() { function isInGitRepository(): boolean {
try { try {
execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore' }) execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore' })
return true return true
...@@ -10,7 +10,7 @@ function isInGitRepository() { ...@@ -10,7 +10,7 @@ function isInGitRepository() {
return false return false
} }
function isInMercurialRepository() { function isInMercurialRepository(): boolean {
try { try {
execSync('hg --cwd . root', { stdio: 'ignore' }) execSync('hg --cwd . root', { stdio: 'ignore' })
return true return true
...@@ -18,7 +18,7 @@ function isInMercurialRepository() { ...@@ -18,7 +18,7 @@ function isInMercurialRepository() {
return false return false
} }
export function tryGitInit(root: string) { export function tryGitInit(root: string): boolean {
let didInit = false let didInit = false
try { try {
execSync('git --version', { stdio: 'ignore' }) execSync('git --version', { stdio: 'ignore' })
......
...@@ -2,7 +2,7 @@ import chalk from 'chalk' ...@@ -2,7 +2,7 @@ import chalk from 'chalk'
import fs from 'fs' import fs from 'fs'
import path from 'path' import path from 'path'
export function isFolderEmpty(root: string, name: string) { export function isFolderEmpty(root: string, name: string): boolean {
const validFiles = [ const validFiles = [
'.DS_Store', '.DS_Store',
'.git', '.git',
......
import { execSync } from 'child_process' import { execSync } from 'child_process'
export function shouldUseYarn() { export function shouldUseYarn(): boolean {
try { try {
const userAgent = process.env.npm_config_user_agent const userAgent = process.env.npm_config_user_agent
if (userAgent) { 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