Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
cf0b1d94
Unverified
Commit
cf0b1d94
authored
May 10, 2020
by
Maxi Gimenez
Committed by
GitHub
May 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(create-next-app): add missing return types on helpers (#12616)
Co-authored-by:
Tim Neutkens
<
tim@timneutkens.nl
>
parent
61599b85
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
examples.ts
packages/create-next-app/helpers/examples.ts
+1
-1
git.ts
packages/create-next-app/helpers/git.ts
+3
-3
is-folder-empty.ts
packages/create-next-app/helpers/is-folder-empty.ts
+1
-1
should-use-yarn.ts
packages/create-next-app/helpers/should-use-yarn.ts
+1
-1
No files found.
packages/create-next-app/helpers/examples.ts
View file @
cf0b1d94
...
@@ -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
}
}
...
...
packages/create-next-app/helpers/git.ts
View file @
cf0b1d94
...
@@ -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'
})
...
...
packages/create-next-app/helpers/is-folder-empty.ts
View file @
cf0b1d94
...
@@ -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'
,
...
...
packages/create-next-app/helpers/should-use-yarn.ts
View file @
cf0b1d94
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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment