Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Toolchain
sgc
Commits
cbe8445a
Commit
cbe8445a
authored
Jan 09, 2015
by
Philipp Nowinski
Browse files
[TASK] nest prompts under priority
parent
b37dba8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/index.js
View file @
cbe8445a
...
...
@@ -27,88 +27,89 @@ module.exports = yeoman.generators.Base.extend((function() {
Generator
.
pkg
=
require
(
'
../package.json
'
);
};
Generator
.
prompting
=
function
()
{
var
done
=
this
.
async
();
// Greet the user
this
.
log
(
yosay
(
'
Welcome to the dandy
'
+
chalk
.
red
(
'
Sgalinski
'
)
+
'
generator!
'
));
this
.
prompt
({
type
:
'
list
'
,
name
:
'
projectType
'
,
message
:
'
What kind of project do you want me to build?
'
,
choices
:
[
Generator
.
prompting
=
{
basicPrompts
:
function
()
{
var
done
=
this
.
async
();
// Greet the user
this
.
log
(
yosay
(
'
Welcome to the dandy
'
+
chalk
.
red
(
'
Sgalinski
'
)
+
'
generator!
'
));
this
.
prompt
({
type
:
'
list
'
,
name
:
'
projectType
'
,
message
:
'
What kind of project do you want me to build?
'
,
choices
:
[
{
value
:
'
extbaseExtension
'
,
name
:
'
Typo3 Extbase Extension
'
},
{
value
:
'
standalone
'
,
name
:
'
Standalone Frontend Project
'
},
{
value
:
'
typo3Frontend
'
,
name
:
'
Typo3 Frontend Setup
'
}
]
},
function
(
answers
)
{
projectType
=
answers
.
projectType
done
();
});
},
advancedPrompts
:
function
()
{
var
done
=
this
.
async
(),
questions
;
// define questions
questions
=
[
{
type
:
'
input
'
,
name
:
'
projectName
'
,
message
:
'
Please enter the name for your project
'
,
default
:
process
.
cwd
().
split
(
path
.
sep
).
pop
()
},
{
type
:
'
input
'
,
name
:
'
cssPath
'
,
message
:
'
Please specify the path to the compiled css files
'
,
default
:
resourcePathsSuggestions
[
projectType
].
cssPath
},
{
type
:
'
input
'
,
name
:
'
sassPath
'
,
message
:
'
Please specify the path to the sass source files
'
,
default
:
resourcePathsSuggestions
[
projectType
].
sassPath
},
{
value
:
'
extbaseExtension
'
,
name
:
'
Typo3 Extbase Extension
'
type
:
'
input
'
,
name
:
'
javascriptPath
'
,
message
:
'
Please specify the path to the javascript files
'
,
default
:
resourcePathsSuggestions
[
projectType
].
javascriptPath
},
{
value
:
'
standalone
'
,
name
:
'
Standalone Frontend Project
'
type
:
'
input
'
,
name
:
'
compassConfigPath
'
,
message
:
'
Please specify the path to config.rb file for compass
'
,
default
:
'
.
'
},
{
value
:
'
typo3Frontend
'
,
name
:
'
Typo3 Frontend Setup
'
type
:
'
input
'
,
name
:
'
imagesPath
'
,
message
:
'
Please specify the path to the images
'
,
default
:
resourcePathsSuggestions
[
projectType
].
imagesPath
}
]
},
function
(
answers
)
{
projectType
=
answers
.
projectType
done
();
});
};
];
Generator
.
advancedPrompting
=
function
()
{
var
done
=
this
.
async
(),
questions
;
// define questions
questions
=
[
{
type
:
'
input
'
,
name
:
'
projectName
'
,
message
:
'
Please enter the name for your project
'
,
default
:
process
.
cwd
().
split
(
path
.
sep
).
pop
()
},
{
type
:
'
input
'
,
name
:
'
cssPath
'
,
message
:
'
Please specify the path to the compiled css files
'
,
default
:
resourcePathsSuggestions
[
projectType
].
cssPath
},
{
type
:
'
input
'
,
name
:
'
sassPath
'
,
message
:
'
Please specify the path to the sass source files
'
,
default
:
resourcePathsSuggestions
[
projectType
].
sassPath
},
{
type
:
'
input
'
,
name
:
'
javascriptPath
'
,
message
:
'
Please specify the path to the javascript files
'
,
default
:
resourcePathsSuggestions
[
projectType
].
javascriptPath
},
{
type
:
'
input
'
,
name
:
'
compassConfigPath
'
,
message
:
'
Please specify the path to config.rb file for compass
'
,
default
:
'
.
'
},
{
type
:
'
input
'
,
name
:
'
imagesPath
'
,
message
:
'
Please specify the path to the images
'
,
default
:
resourcePathsSuggestions
[
projectType
].
imagesPath
}
];
// ask questions
this
.
prompt
(
questions
,
function
(
_answers
)
{
answers
=
_answers
;
done
();
});
};
// ask questions
this
.
prompt
(
questions
,
function
(
_answers
)
{
answers
=
_answers
;
done
();
});
}
}
Generator
.
writeGeneralConfigs
=
function
()
{
this
.
fs
.
copy
(
...
...
Write
Preview
Supports
Markdown
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