-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added support for branches, global fields
- Loading branch information
1 parent
51428a6
commit b1c7fc1
Showing
13 changed files
with
100 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as chalk from 'chalk'; | ||
import { log, fsUtil } from '../../utils'; | ||
import { join } from 'path'; | ||
import { ImportConfig, ModuleClassParams } from '../../types'; | ||
import BaseImportSetup from './base-setup'; | ||
|
||
export default class GlobalFieldsImportSetup extends BaseImportSetup { | ||
constructor(options: ModuleClassParams) { | ||
super(options); | ||
} | ||
|
||
async start() { | ||
try { | ||
await this.setupDependencies(); | ||
log(this.config, `Generate required setup files for global fields`, 'success'); | ||
} catch (error) { | ||
log(this.config, `Error generating ${error.message}`, 'error'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import chalk from 'chalk'; | ||
import { log } from '../utils'; | ||
import { ImportConfig } from 'src/types'; | ||
|
||
export const validateBranch = async (stackAPIClient: any, config: ImportConfig, branch: any) => { | ||
return new Promise(async (resolve, reject) => { | ||
try { | ||
const data = await stackAPIClient.branch(branch).fetch(); | ||
if (data && typeof data === 'object') { | ||
if (data.error_message) { | ||
log(config, chalk.red(data.error_message), 'error'); | ||
log(config, chalk.red('No branch found with the name ' + branch), 'error'); | ||
reject({ message: 'No branch found with the name ' + branch, error: data.error_message }); | ||
} else { | ||
resolve(data); | ||
} | ||
} else { | ||
reject({ message: 'No branch found with the name ' + branch, error: {} }); | ||
} | ||
} catch (error) { | ||
log(config, chalk.red('No branch found with the name ' + branch), 'error'); | ||
reject({ message: 'No branch found with the name ' + branch, error }); | ||
} | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters