Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
courses
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
R3
school
courses
Commits
3be80539
Commit
3be80539
authored
5 years ago
by
Laurent Heirendt
Browse files
Options
Downloads
Patches
Plain Diff
add copy of gruntfile and fct of symlink
parent
1e1a72af
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contribute.py
+18
-12
18 additions, 12 deletions
contribute.py
with
18 additions
and
12 deletions
contribute.py
+
18
−
12
View file @
3be80539
...
...
@@ -2,6 +2,7 @@ import click
import
datetime
import
os
from
distutils.dir_util
import
copy_tree
from
shutil
import
copyfile
@click.command
()
@click.option
(
'
--date
'
,
default
=
datetime
.
datetime
.
today
().
strftime
(
'
%Y-%m-%d
'
),
help
=
'
Date of the presentation - format: YYYY-MM-DD
'
)
...
...
@@ -46,18 +47,8 @@ def main(date, name):
os
.
chdir
(
fullPath
)
# generate the symlink to the theme
if
not
os
.
path
.
islink
(
'
theme
'
):
os
.
symlink
(
'
../../theme
'
,
'
theme
'
)
click
.
echo
(
'
> Symlink to theme created.
'
)
else
:
click
.
echo
(
'
> Symlink to theme already exists.
'
)
# generate the symlink to the package.json file
if
not
os
.
path
.
islink
(
'
package.json
'
):
os
.
symlink
(
'
../../theme/package.json
'
,
'
package.json
'
)
click
.
echo
(
'
> Symlink to package.json created.
'
)
else
:
click
.
echo
(
'
> Symlink to package.json already exists.
'
)
createSymlink
(
'
../../theme
'
,
'
theme
'
)
createSymlink
(
'
../../theme/package.json
'
,
'
package.json
'
)
# copy the contents of the template folder
if
not
os
.
path
.
isfile
(
os
.
path
.
join
(
fullPath
,
'
slides
'
,
'
index.md
'
)):
...
...
@@ -67,6 +58,21 @@ def main(date, name):
click
.
echo
(
'
> Slide deck already exists.
'
)
# copy the Gruntfile
if
not
os
.
path
.
isfile
(
os
.
path
.
join
(
fullPath
,
'
Gruntfile.coffee
'
)):
copyfile
(
os
.
path
.
join
(
rootDir
,
'
template
'
,
'
Gruntfile.coffee
'
),
os
.
path
.
join
(
fullPath
,
'
Gruntfile.coffee
'
))
click
.
echo
(
'
> Gruntfile copied.
'
)
else
:
click
.
echo
(
'
> Gruntfile already exists.
'
)
def
createSymlink
(
src
,
dst
):
if
not
os
.
path
.
islink
(
dst
):
os
.
symlink
(
src
,
dst
)
click
.
echo
(
'
> Symlink to {0} created.
'
.
format
(
dst
))
else
:
click
.
echo
(
'
> Symlink to {0} already exists.
'
.
format
(
dst
))
def
validateDate
(
input
):
"""
Validate a date string to fit the ISO format
"""
...
...
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