Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
65f16117
Commit
65f16117
authored
Aug 13, 2018
by
Nicolas Giard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: installer (wip)
parent
c4c1cf00
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
main.go
dev/installer/main.go
+54
-0
No files found.
dev/installer/main.go
0 → 100644
View file @
65f16117
package
main
import
(
"fmt"
"runtime"
"time"
"github.com/gosuri/uiprogress"
"github.com/manifoldco/promptui"
"github.com/ttacon/chalk"
)
var
logo
=
`
__ __ _ _ _ _
/ / /\ \ (_) | _(_) (_)___
\ \/ \/ / | |/ / | | / __|
\ /\ /| | <| |_ | \__ \
\/ \/ |_|_|\_\_(_)/ |___/
|__/
`
func
main
()
{
fmt
.
Println
(
chalk
.
Yellow
.
Color
(
logo
))
fmt
.
Println
(
chalk
.
Bold
.
TextStyle
(
"Installer for Wiki.js 2.x"
))
fmt
.
Printf
(
"for %s-%s
\n\n
"
,
runtime
.
GOOS
,
runtime
.
GOARCH
)
// Prompt for build to install
prompt
:=
promptui
.
Select
{
Label
:
"Select Build to install"
,
Items
:
[]
string
{
"Stable"
,
"Dev"
},
}
_
,
result
,
err
:=
prompt
.
Run
()
if
err
!=
nil
{
fmt
.
Printf
(
"Prompt failed %v
\n
"
,
err
)
return
}
fmt
.
Printf
(
"You choose %q
\n
"
,
result
)
// Download archives...
uiprogress
.
Start
()
bar
:=
uiprogress
.
AddBar
(
100
)
bar
.
AppendCompleted
()
bar
.
PrependElapsed
()
for
bar
.
Incr
()
{
time
.
Sleep
(
time
.
Millisecond
*
20
)
}
}
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