Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename jbrowse cli add-track --type to --trackType #1565

Merged
merged 2 commits into from
Dec 17, 2020
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
2 changes: 1 addition & 1 deletion products/jbrowse-cli/src/commands/add-track.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ describe('add-track', () => {
'customTrackId',
'--description',
'new description',
'--type',
'--trackType',
'CustomTrackType',
'--category',
'newcategory',
Expand Down
8 changes: 4 additions & 4 deletions products/jbrowse-cli/src/commands/add-track.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class AddTrack extends JBrowseCommand {
'$ jbrowse add-track /path/to/my.bam --load copy',
'$ jbrowse add-track /path/to/my.bam --target /path/to/jbrowse2/installation/config.json --load symlink',
'$ jbrowse add-track https://mywebsite.com/my.bam',
`$ jbrowse add-track /path/to/my.bam --type AlignmentsTrack --name 'New Track' --load move`,
`$ jbrowse add-track /path/to/my.bam --trackType AlignmentsTrack --name 'New Track' --load move`,
`$ jbrowse add-track /path/to/my.bam --trackId AlignmentsTrack1 --load inPlace --overwrite`,
`$ jbrowse add-track /path/to/my.bam --config '{"defaultRendering": "density"}'`,
]
Expand All @@ -53,7 +53,7 @@ export default class AddTrack extends JBrowseCommand {
]

static flags = {
type: flags.string({
trackType: flags.string({
char: 't',
description: `Type of track, by default inferred from track file`,
}),
Expand Down Expand Up @@ -143,7 +143,7 @@ export default class AddTrack extends JBrowseCommand {
const isDir = (await fsPromises.lstat(output)).isDirectory()
this.target = isDir ? `${output}/config.json` : output

let { type, trackId, name, assemblyNames } = runFlags
let { trackType, trackId, name, assemblyNames } = runFlags

const configDirectory = path.dirname(this.target)
if (!argsTrack) {
Expand Down Expand Up @@ -208,7 +208,7 @@ export default class AddTrack extends JBrowseCommand {
}

// set up the track information
type = type || this.guessTrackType(adapter.type)
const type = trackType || this.guessTrackType(adapter.type)
trackId = trackId || path.basename(location, path.extname(location))
name = name || trackId
assemblyNames = assemblyNames || configContents.assemblies[0].name
Expand Down