Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
123
Merge Requests
15
CI / CD
Security & Compliance
Packages
Analytics
Wiki
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds
Commits
7d4cd5c3
Commit
7d4cd5c3
authored
18 hours ago
by
Emiliano Balbuena
Browse files
Options
Download
(feat): Check core.autocrlf value when running script
parent
eb1805a5
chore/local-infra-tweaks
1 merge request
!175
WIP: Local stack tweaks
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
local/cli.js
View file @
7d4cd5c3
const
yargs
=
require
(
'
yargs
'
);
const
getMissingDeps
=
require
(
'
./helpers/get-missing-deps
'
);
const
repoHealth
=
require
(
'
./helpers/repo-health
'
);
return
(
async
()
=>
{
const
missingDeps
=
await
getMissingDeps
();
...
...
@@ -11,6 +12,8 @@ return (async () => {
return
process
.
exit
(
1
);
}
await
repoHealth
();
return
yargs
.
option
(
'
verbose
'
,
{
description
:
'
Verbose output
'
,
...
...
@@ -20,8 +23,8 @@ return (async () => {
description
:
'
Silent output
'
,
boolean
:
true
})
.
command
(
'
up
'
,
'
Start the containers
'
,
require
(
'
./commands/up
'
))
.
command
(
'
down
'
,
'
Stop the containers
'
,
require
(
'
./commands/down
'
))
.
command
(
[
'
up
'
,
'
start
'
]
,
'
Start the containers
'
,
require
(
'
./commands/up
'
))
.
command
(
[
'
down
'
,
'
stop
'
]
,
'
Stop the containers
'
,
require
(
'
./commands/down
'
))
.
command
(
'
restart
'
,
'
Restart the containers
'
,
require
(
'
./commands/restart
'
))
.
command
(
'
rebuild
'
,
'
Rebuild the containers
'
,
require
(
'
./commands/rebuild
'
))
.
command
(
'
install
'
,
'
Installs and provisions the compose stack
'
,
require
(
'
./commands/install
'
))
...
...
This diff is collapsed.
local/helpers/repo-health.js
0 → 100644
View file @
7d4cd5c3
const
exec
=
require
(
'
../lib/exec
'
);
module
.
exports
=
async
function
()
{
const
getAutoCrLf
=
async
dir
=>
{
try
{
const
subprocess
=
await
exec
.
in
(
dir
,
'
git
'
,
[
'
config
'
,
'
--get
'
,
'
core.autocrlf
'
]);
return
(
subprocess
.
stdout
||
''
).
trim
().
toLowerCase
();
}
catch
(
e
)
{
return
false
;
}
}
const
badAutoCrLfValue
=
'
true
'
;
const
willCauseIssues
=
(
await
Promise
.
all
([
getAutoCrLf
(
''
),
getAutoCrLf
(
'
front
'
),
getAutoCrLf
(
'
engine
'
),
getAutoCrLf
(
'
sockets
'
),
])).
some
(
autocrlf
=>
autocrlf
===
badAutoCrLfValue
);
if
(
willCauseIssues
)
{
process
.
stderr
.
write
(
`\nWARNING: One or more repositories have 'core.autocrlf' set to '
${
badAutoCrLfValue
}
'. `
+
'
This will cause issues with containerized scripts and provisioners. Please check
'
+
'
Minds Developers documentation.
\n\n
'
);
}
};
This diff is collapsed.
Please
register
or
sign in
to comment