Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
catladder
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
catladder
catladder
Commits
6fadf9ea
Commit
6fadf9ea
authored
9 months ago
by
Marco Wettstein
Browse files
Options
Downloads
Patches
Plain Diff
chore: remove unused file
parent
81a23fae
No related branches found
Branches containing commit
Tags
v1.140.0
Tags containing commit
No related merge requests found
Pipeline
#257309
passed
9 months ago
Stage: test
Stage: build
Stage: deploy
Stage: release
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cli/src/apps/cli/config/writeConfig.ts
+0
-71
0 additions, 71 deletions
cli/src/apps/cli/config/writeConfig.ts
with
0 additions
and
71 deletions
cli/src/apps/cli/config/writeConfig.ts
deleted
100644 → 0
+
0
−
71
View file @
81a23fae
import
type
{
Config
}
from
"
@catladder/pipeline
"
;
import
{
spawn
,
exec
}
from
"
child-process-promise
"
;
import
{
writeFile
}
from
"
fs-extra
"
;
import
{
dump
}
from
"
js-yaml
"
;
import
{
format
}
from
"
prettier
"
;
import
type
{
CommandInstance
}
from
"
vorpal
"
;
import
{
getGitRoot
}
from
"
../../../utils/projects
"
;
export
const
writeConfig
=
async
(
vorpal
:
CommandInstance
,
config
:
Config
,
options
?:
{
endComment
?:
string
;
}
)
=>
{
const
gitRoot
=
await
getGitRoot
();
const
TS
=
"
typescript (recommended)
"
;
const
{
configType
}
=
await
vorpal
.
prompt
({
type
:
"
list
"
,
name
:
"
configType
"
,
choices
:
[
TS
,
"
yaml
"
],
message
:
"
In which format do you want the config? 🤔
"
,
});
vorpal
.
log
(
""
);
if
(
configType
===
TS
)
{
const
file
=
gitRoot
+
"
/catladder.ts
"
;
const
content
=
format
(
`
import type { Config } from "@catladder/pipeline";
const config: Config =
${
JSON
.
stringify
(
config
)}
;
export default config;
${
options
?.
endComment
?
`/*
${
options
.
endComment
}
*/`
:
""
}
`
,
{
parser
:
"
babel
"
,
}
);
await
writeFile
(
file
,
content
,
{
encoding
:
"
utf-8
"
,
});
vorpal
.
log
(
"
adding type @catladder/pipeline....
"
);
await
spawn
(
"
yarn add --non-interactive @catladder/pipeline -DW
"
,
{
shell
:
true
,
});
await
exec
(
"
git add
"
+
file
);
}
else
{
const
file
=
gitRoot
+
"
/catladder.yml
"
;
const
content
=
dump
(
config
);
await
writeFile
(
file
,
content
+
"
\n\n
"
+
(
options
.
endComment
?
"
#
"
+
options
.
endComment
.
split
(
"
\n
"
).
join
(
"
\n
#
"
)
:
""
),
{
encoding
:
"
utf-8
"
,
}
);
await
exec
(
"
git add
"
+
file
);
}
vorpal
.
log
(
"
done!
"
);
vorpal
.
log
(
""
);
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment