Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/commands/create.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import inquirer from 'inquirer'
import component from './create/component.js'
import question from './create/question.js'
import extension from './create/extension.js'
import course from './create/course.js'
import { ADAPT_FRAMEWORK } from '../util/constants.js'
import { getLatestVersion as getAdaptLatestVersion } from '../integration/AdaptFramework.js'

const subTasks = {
component,
question,
extension,
course
}

Expand All @@ -17,7 +19,8 @@ const subTasks = {
export const DEFAULT_TYPE_NAME = {
course: 'my-adapt-course',
component: 'myAdaptComponent',
question: 'myAdaptQuestion'
question: 'myAdaptQuestion',
extension: 'myAdaptExtension'
}

export default async function create (logger, type = 'course', name, branch, bypassPrompts) {
Expand Down Expand Up @@ -55,7 +58,7 @@ async function confirmOptions ({ logger, type, name, branch }) {
const typeSchema = [
{
name: 'type',
choices: ['course', 'component', 'question'],
choices: ['course', 'component', 'question', 'extension'],
type: 'list',
default: type
}
Expand Down
18 changes: 18 additions & 0 deletions lib/commands/create/extension.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import component from 'adapt-cli/lib/commands/create/component.js'
import { ADAPT_EXTENSION } from 'adapt-cli/lib/util/constants.js'

export default async function extension ({
name,
repository = ADAPT_EXTENSION,
cwd,
branch,
logger
}) {
return component({
name,
repository,
cwd,
branch,
logger
})
}
2 changes: 2 additions & 0 deletions lib/util/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export const ADAPT_COMPONENT = process.env.ADAPT_COMPONENT || 'https://github.co

export const ADAPT_QUESTION = process.env.ADAPT_QUESTION || 'https://github.com/adaptlearning/adapt-questionComponent'

export const ADAPT_EXTENSION = process.env.ADAPT_EXTENSION || 'https://github.com/adaptlearning/adapt-extension'

export const ADAPT_DEFAULT_USER_AGENT = process.env.ADAPT_DEFAULT_USER_AGENT || 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36'

export const HOME_DIRECTORY = [
Expand Down
Loading