Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
devcontainer-features
Project
Project
Details
Activity
Releases
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
eazydevelop-devcontainer-temp
devcontainer-features
Commits
2e073cde
Commit
2e073cde
authored
Jun 22, 2022
by
Josh Spicer
Committed by
GitHub
Jun 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no-ci update action (concurrency)
parent
941f4d42
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
47 deletions
+41
-47
index.js
.github/devcontainers-action/dist/index.js
+20
-23
index.js.map
.github/devcontainers-action/dist/index.js.map
+1
-1
main.js
.github/devcontainers-action/lib/main.js
+0
-1
utils.js
.github/devcontainers-action/lib/utils.js
+20
-22
No files found.
.github/devcontainers-action/dist/index.js
View file @
2e073cde
...
...
@@ -255,7 +255,6 @@ function packageTemplates(basePath) {
}
});
}
// Kick off execution
run
();
...
...
@@ -358,30 +357,28 @@ function addCollectionsMetadataFile(featuresMetadata, templatesMetadata) {
exports
.
addCollectionsMetadataFile
=
addCollectionsMetadataFile
;
function
getFeaturesAndPackage
(
basePath
)
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
*
()
{
const
featureDirs
=
fs
.
readdirSync
(
basePath
);
let
metadatas
=
[];
fs
.
readdir
(
basePath
,
(
err
,
files
)
=>
{
if
(
err
)
{
core
.
error
(
err
.
message
);
core
.
setFailed
(
`failed to get list of features:
${
err
.
message
}
`
);
return
;
}
files
.
forEach
(
file
=>
{
core
.
info
(
`feature ==>
${
file
}
`
);
if
(
file
!==
'.'
&&
file
!==
'..'
)
{
const
featureFolder
=
path_1
.
default
.
join
(
basePath
,
file
);
const
archiveName
=
`
${
file
}
.tgz`
;
tarDirectory
(
`
${
basePath
}
/
${
file
}
`
,
archiveName
);
const
featureJsonPath
=
path_1
.
default
.
join
(
featureFolder
,
'devcontainer-feature.json'
);
if
(
!
fs
.
existsSync
(
featureJsonPath
))
{
core
.
error
(
`Feature
${
file
}
is missing a devcontainer-feature.json`
);
core
.
setFailed
(
'All features must have a devcontainer-feature.json'
);
return
;
}
const
featureMetadata
=
JSON
.
parse
(
fs
.
readFileSync
(
featureJsonPath
,
'utf8'
));
metadatas
.
push
(
featureMetadata
);
yield
Promise
.
all
(
featureDirs
.
map
((
f
)
=>
__awaiter
(
this
,
void
0
,
void
0
,
function
*
()
{
core
.
info
(
`feature ==>
${
f
}
`
);
if
(
f
!==
'.'
&&
f
!==
'..'
)
{
const
featureFolder
=
path_1
.
default
.
join
(
basePath
,
f
);
const
archiveName
=
`
${
f
}
.tgz`
;
yield
tarDirectory
(
`
${
basePath
}
/
${
f
}
`
,
archiveName
);
const
featureJsonPath
=
path_1
.
default
.
join
(
featureFolder
,
'devcontainer-feature.json'
);
if
(
!
fs
.
existsSync
(
featureJsonPath
))
{
core
.
error
(
`Feature
${
f
}
is missing a devcontainer-feature.json`
);
core
.
setFailed
(
'All features must have a devcontainer-feature.json'
);
return
;
}
});
});
const
featureMetadata
=
JSON
.
parse
(
fs
.
readFileSync
(
featureJsonPath
,
'utf8'
));
metadatas
.
push
(
featureMetadata
);
}
})));
if
(
metadatas
.
length
===
0
)
{
core
.
setFailed
(
'No features found'
);
return
;
}
return
metadatas
;
});
}
...
...
.github/devcontainers-action/dist/index.js.map
View file @
2e073cde
This source diff could not be displayed because it is too large. You can
view the blob
instead.
.github/devcontainers-action/lib/main.js
View file @
2e073cde
...
...
@@ -104,5 +104,4 @@ function packageTemplates(basePath) {
}
});
}
// Kick off execution
run
();
.github/devcontainers-action/lib/utils.js
View file @
2e073cde
...
...
@@ -91,30 +91,28 @@ function addCollectionsMetadataFile(featuresMetadata, templatesMetadata) {
exports
.
addCollectionsMetadataFile
=
addCollectionsMetadataFile
;
function
getFeaturesAndPackage
(
basePath
)
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
*
()
{
const
featureDirs
=
fs
.
readdirSync
(
basePath
);
let
metadatas
=
[];
fs
.
readdir
(
basePath
,
(
err
,
files
)
=>
{
if
(
err
)
{
core
.
error
(
err
.
message
);
core
.
setFailed
(
`failed to get list of features:
${
err
.
message
}
`
);
return
;
}
files
.
forEach
(
file
=>
{
core
.
info
(
`feature ==>
${
file
}
`
);
if
(
file
!==
'.'
&&
file
!==
'..'
)
{
const
featureFolder
=
path_1
.
default
.
join
(
basePath
,
file
);
const
archiveName
=
`
${
file
}
.tgz`
;
tarDirectory
(
`
${
basePath
}
/
${
file
}
`
,
archiveName
);
const
featureJsonPath
=
path_1
.
default
.
join
(
featureFolder
,
'devcontainer-feature.json'
);
if
(
!
fs
.
existsSync
(
featureJsonPath
))
{
core
.
error
(
`Feature
${
file
}
is missing a devcontainer-feature.json`
);
core
.
setFailed
(
'All features must have a devcontainer-feature.json'
);
return
;
}
const
featureMetadata
=
JSON
.
parse
(
fs
.
readFileSync
(
featureJsonPath
,
'utf8'
));
metadatas
.
push
(
featureMetadata
);
yield
Promise
.
all
(
featureDirs
.
map
((
f
)
=>
__awaiter
(
this
,
void
0
,
void
0
,
function
*
()
{
core
.
info
(
`feature ==>
${
f
}
`
);
if
(
f
!==
'.'
&&
f
!==
'..'
)
{
const
featureFolder
=
path_1
.
default
.
join
(
basePath
,
f
);
const
archiveName
=
`
${
f
}
.tgz`
;
yield
tarDirectory
(
`
${
basePath
}
/
${
f
}
`
,
archiveName
);
const
featureJsonPath
=
path_1
.
default
.
join
(
featureFolder
,
'devcontainer-feature.json'
);
if
(
!
fs
.
existsSync
(
featureJsonPath
))
{
core
.
error
(
`Feature
${
f
}
is missing a devcontainer-feature.json`
);
core
.
setFailed
(
'All features must have a devcontainer-feature.json'
);
return
;
}
});
});
const
featureMetadata
=
JSON
.
parse
(
fs
.
readFileSync
(
featureJsonPath
,
'utf8'
));
metadatas
.
push
(
featureMetadata
);
}
})));
if
(
metadatas
.
length
===
0
)
{
core
.
setFailed
(
'No features found'
);
return
;
}
return
metadatas
;
});
}
...
...
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