-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* removed apps file * added cli folder * added template args * added command option parsing * added command behaviors * changed package version * added publish CI
- Loading branch information
Showing
13 changed files
with
321 additions
and
183 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
name: Publish to NPM | ||
on: | ||
release: | ||
types: [created] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12.x" | ||
registry-url: "https://registry.npmjs.org" | ||
- run: yarn | ||
- run: npm publish --access=public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
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,7 @@ | ||
tests | ||
scripts | ||
src | ||
img | ||
.vscode | ||
.github | ||
*.md |
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 was deleted.
Oops, something went wrong.
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,51 @@ | ||
#!/usr/bin/env ts-node | ||
//note: this cli script is for testing and being executed directly from source | ||
|
||
import path from 'path'; | ||
import { GlitchGit, GlitchProject } from '../src/models'; | ||
|
||
const gitPushTest = async () => { | ||
const source = process.env.REPO_SOURCE; | ||
|
||
if (typeof source === 'undefined') { | ||
throw new Error('target repository has not been provided'); | ||
} | ||
|
||
// the folder to where it will copy things | ||
const targetFolder = 'target'; | ||
|
||
const glitchRepo = new GlitchGit(source, true); | ||
|
||
await glitchRepo.publishFilesToGlitch(path.join(__dirname, targetFolder)); | ||
}; | ||
|
||
const gitImportTest = async () => { | ||
const projId = process.env.GLITCH_PROJ_ID; | ||
const token = process.env.GLITCH_USER_TOKEN; | ||
|
||
if (typeof projId === 'undefined' || typeof token === 'undefined') { | ||
throw new Error('the required environment variables were not provided'); | ||
} | ||
|
||
const sourceRepo = 'staketechnologies/lockdrop-ui'; | ||
const glitchProj = new GlitchProject(token, projId); | ||
|
||
const res = await glitchProj.importFromGithub(sourceRepo, 'public'); | ||
|
||
if (res.status !== 200) { | ||
throw new Error('Failed to import project'); | ||
} | ||
console.log('successfully imported project ' + sourceRepo); | ||
}; | ||
|
||
// script entry point | ||
(async () => { | ||
throw new Error('Script not implemented!'); | ||
//await gitPushTest(); | ||
//await gitImportTest(); | ||
|
||
//process.exit(0); | ||
})().catch((err) => { | ||
console.error(err); | ||
process.exit(1); | ||
}); |
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
import { GlitchGit, GlitchProject } from '../models'; | ||
|
||
export const importFromFolder = async (repoUrl: string, targetPath?: string, debugMessage?: boolean) => { | ||
const glitchRepo = new GlitchGit(repoUrl, debugMessage); | ||
|
||
await glitchRepo.publishFilesToGlitch(targetPath); | ||
|
||
console.log('successfully imported projects from ' + targetPath); | ||
}; | ||
|
||
export const importFromGithub = async (token: string, projId: string, repo: string, path?: string) => { | ||
if (typeof projId === 'undefined' || typeof token === 'undefined') { | ||
throw new Error('the required environment variables were not provided'); | ||
} | ||
const glitchProj = new GlitchProject(token, projId); | ||
|
||
const res = await glitchProj.importFromGithub(repo, path); | ||
|
||
if (res.status !== 200) { | ||
throw new Error('Failed to import project'); | ||
} | ||
console.log('successfully imported project ' + repo); | ||
}; |
Oops, something went wrong.