clone.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.GitCloneCommand = void 0;
  4. const cli_framework_1 = require("@ionic/cli-framework");
  5. const command_1 = require("../../lib/command");
  6. // import { formatGitRepoUrl } from '../../lib/git';
  7. class GitCloneCommand extends command_1.Command {
  8. async getMetadata() {
  9. return {
  10. name: 'clone',
  11. type: 'global',
  12. summary: 'Clones an Ionic app git repository to your computer',
  13. inputs: [
  14. {
  15. name: 'id',
  16. summary: 'The ID of the Ionic Appflow app to clone',
  17. validators: [cli_framework_1.validators.required],
  18. },
  19. {
  20. name: 'path',
  21. summary: 'The destination directory of the cloned app',
  22. },
  23. ],
  24. groups: ["hidden" /* MetadataGroup.HIDDEN */], // TODO: make part of start?
  25. };
  26. }
  27. async run(inputs, options) {
  28. // let [ id, destination ] = inputs;
  29. // const appLoader = new App(this.env.session.getUserToken(), this.env.client);
  30. // const app = await appLoader.load(id);
  31. // const remote = await formatGitRepoUrl(this.env.config, app.id);
  32. // if (!destination) {
  33. // destination = app.slug ? app.slug : app.id;
  34. // }
  35. // destination = path.resolve(destination);
  36. // await this.env.shell.run('git', ['clone', '-o', 'ionic', remote, destination], { stdio: 'inherit' });
  37. // this.env.log.ok(`Your app has been cloned to ${strong(prettyPath(destination))}!`);
  38. }
  39. }
  40. exports.GitCloneCommand = GitCloneCommand;