Skip to content

Commit

Permalink
run action
Browse files Browse the repository at this point in the history
  • Loading branch information
Chadiii committed Feb 22, 2024
1 parent fff9f8f commit ef463f4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: echo "The variable is ${{ steps.newVar.outputs.variable_value }}"

- name: List ls
run: ls
run: ls -all

- name: List Flagship
run: ls flagship
Expand Down
15 changes: 10 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions src/cliDownloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import decompress from 'decompress'

export async function CliDownloader(binaryDir: string) {
const flagshipDir = 'flagship'
const internalFlagshipDir = '.flagship/configurations'
const cliTar = `flagship/flagship-${CliVersion}.tar.gz`

async function installDir(): Promise<void> {
Expand All @@ -26,10 +25,6 @@ export async function CliDownloader(binaryDir: string) {
fs.mkdirSync(binaryDir)
}

if (!fs.existsSync(internalFlagshipDir)) {
fs.mkdirSync(internalFlagshipDir)
}

if (platform === 'win32') {
platform = 'windows'
}
Expand Down Expand Up @@ -66,7 +61,6 @@ export async function CliDownloader(binaryDir: string) {
}
await decompress(cliTar, binaryDir)
fs.chmodSync(`${binaryDir}/flagship`, '777')
fs.chmodSync(`${internalFlagshipDir}`, '777')
}

async function download(): Promise<void> {
Expand Down
14 changes: 14 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ export async function run(): Promise<void> {
try {
const flagshipDir = 'flagship'
const binaryDir = `${flagshipDir}/${CliVersion}`
const internalFlagshipDir = '.flagship'
const internalConfigutations = `${internalFlagshipDir}/configurations`

if (!fs.existsSync(internalFlagshipDir)) {
fs.mkdirSync(internalFlagshipDir)
}

fs.chmodSync(`${internalFlagshipDir}`, '777')

if (!fs.existsSync(internalConfigutations)) {
fs.mkdirSync(internalConfigutations)
}

fs.chmodSync(`${internalConfigutations}`, '777')

if (!fs.existsSync(binaryDir)) {
await CliDownloader(binaryDir)
Expand Down

0 comments on commit ef463f4

Please sign in to comment.