-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
381 additions
and
107 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,34 @@ | ||
#!/usr/bin/env zx | ||
|
||
import { $ } from 'zx' | ||
import { mkdir, rm } from 'node:fs/promises' | ||
import { join } from 'node:path' | ||
import { mkdir, rm } from 'node:fs/promises'; | ||
import { join } from 'node:path'; | ||
import { $ } from 'zx'; | ||
|
||
const programs = [{ | ||
id: 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s', | ||
name: 'token_metadata.so', | ||
}] | ||
const programs = [ | ||
{ | ||
id: 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s', | ||
name: 'token_metadata.so', | ||
}, | ||
]; | ||
|
||
const outputDir = 'tests/fixtures' | ||
const overwrite = true | ||
const outputDir = 'tests/fixtures'; | ||
const overwrite = true; | ||
|
||
try { | ||
for (const program of programs) { | ||
const { id, name } = program; | ||
const outputFile = join(outputDir, name) | ||
const outputFile = join(outputDir, name); | ||
await $`solana config set -um`; | ||
|
||
try { | ||
await mkdir(outputDir, { recursive: true }) | ||
if (overwrite) await rm(outputFile, { force: true }) | ||
await $`solana program dump ${id} ${outputFile}` | ||
console.log(`Program ${id} dumped to ${outputFile}`) | ||
await mkdir(outputDir, { recursive: true }); | ||
if (overwrite) await rm(outputFile, { force: true }); | ||
await $`solana program dump ${id} ${outputFile}`; | ||
console.log(`Program ${id} dumped to ${outputFile}`); | ||
} catch (error) { | ||
console.error(`Error dumping ${id}: ${error.message}`) | ||
console.error(`Error dumping ${id}: ${error.message}`); | ||
} | ||
} | ||
} catch (error) { | ||
console.error(`Error preparing programs: ${error.message}`) | ||
console.error(`Error preparing programs: ${error.message}`); | ||
} |
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 |
---|---|---|
@@ -1,31 +1,34 @@ | ||
#!/usr/bin/env zx | ||
|
||
import { $ } from 'zx' | ||
import { mkdir, rm } from 'node:fs/promises' | ||
import { join } from 'node:path' | ||
import { mkdir, rm } from 'node:fs/promises'; | ||
import { join } from 'node:path'; | ||
import { $ } from 'zx'; | ||
|
||
const programs = [{ | ||
id: 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s', | ||
name: 'token_metadata.so', | ||
}] | ||
const programs = [ | ||
{ | ||
id: 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s', | ||
name: 'token_metadata.so', | ||
}, | ||
]; | ||
|
||
const outputDir = 'tests/fixtures' | ||
const overwrite = true | ||
const outputDir = 'tests/fixtures'; | ||
const overwrite = true; | ||
|
||
try { | ||
for (const program of programs) { | ||
const { id, name } = program; | ||
const outputFile = join(outputDir, name) | ||
const outputFile = join(outputDir, name); | ||
await $`solana config set -um`; | ||
|
||
try { | ||
await mkdir(outputDir, { recursive: true }) | ||
if (overwrite) await rm(outputFile, { force: true }) | ||
await $`solana program dump ${id} ${outputFile}` | ||
console.log(`Program ${id} dumped to ${outputFile}`) | ||
await mkdir(outputDir, { recursive: true }); | ||
if (overwrite) await rm(outputFile, { force: true }); | ||
await $`solana program dump ${id} ${outputFile}`; | ||
console.log(`Program ${id} dumped to ${outputFile}`); | ||
} catch (error) { | ||
console.error(`Error dumping ${id}: ${error.message}`) | ||
console.error(`Error dumping ${id}: ${error.message}`); | ||
} | ||
} | ||
} catch (error) { | ||
console.error(`Error preparing programs: ${error.message}`) | ||
console.error(`Error preparing programs: ${error.message}`); | ||
} |
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 |
---|---|---|
@@ -1,31 +1,34 @@ | ||
#!/usr/bin/env zx | ||
|
||
import { $ } from 'zx' | ||
import { mkdir, rm } from 'node:fs/promises' | ||
import { join } from 'node:path' | ||
import { mkdir, rm } from 'node:fs/promises'; | ||
import { join } from 'node:path'; | ||
import { $ } from 'zx'; | ||
|
||
const programs = [{ | ||
id: 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s', | ||
name: 'token_metadata.so', | ||
}] | ||
const programs = [ | ||
{ | ||
id: 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s', | ||
name: 'token_metadata.so', | ||
}, | ||
]; | ||
|
||
const outputDir = 'tests/fixtures' | ||
const overwrite = true | ||
const outputDir = 'tests/fixtures'; | ||
const overwrite = true; | ||
|
||
try { | ||
for (const program of programs) { | ||
const { id, name } = program; | ||
const outputFile = join(outputDir, name) | ||
const outputFile = join(outputDir, name); | ||
await $`solana config set -um`; | ||
|
||
try { | ||
await mkdir(outputDir, { recursive: true }) | ||
if (overwrite) await rm(outputFile, { force: true }) | ||
await $`solana program dump ${id} ${outputFile}` | ||
console.log(`Program ${id} dumped to ${outputFile}`) | ||
await mkdir(outputDir, { recursive: true }); | ||
if (overwrite) await rm(outputFile, { force: true }); | ||
await $`solana program dump ${id} ${outputFile}`; | ||
console.log(`Program ${id} dumped to ${outputFile}`); | ||
} catch (error) { | ||
console.error(`Error dumping ${id}: ${error.message}`) | ||
console.error(`Error dumping ${id}: ${error.message}`); | ||
} | ||
} | ||
} catch (error) { | ||
console.error(`Error preparing programs: ${error.message}`) | ||
console.error(`Error preparing programs: ${error.message}`); | ||
} |
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 |
---|---|---|
@@ -1,31 +1,34 @@ | ||
#!/usr/bin/env zx | ||
|
||
import { $ } from 'zx' | ||
import { mkdir, rm } from 'node:fs/promises' | ||
import { join } from 'node:path' | ||
import { mkdir, rm } from 'node:fs/promises'; | ||
import { join } from 'node:path'; | ||
import { $ } from 'zx'; | ||
|
||
const programs = [{ | ||
id: 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s', | ||
name: 'token_metadata.so', | ||
}] | ||
const programs = [ | ||
{ | ||
id: 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s', | ||
name: 'token_metadata.so', | ||
}, | ||
]; | ||
|
||
const outputDir = 'tests/fixtures' | ||
const overwrite = true | ||
const outputDir = 'tests/fixtures'; | ||
const overwrite = true; | ||
|
||
try { | ||
for (const program of programs) { | ||
const { id, name } = program; | ||
const outputFile = join(outputDir, name) | ||
const outputFile = join(outputDir, name); | ||
await $`solana config set -um`; | ||
|
||
try { | ||
await mkdir(outputDir, { recursive: true }) | ||
if (overwrite) await rm(outputFile, { force: true }) | ||
await $`solana program dump ${id} ${outputFile}` | ||
console.log(`Program ${id} dumped to ${outputFile}`) | ||
await mkdir(outputDir, { recursive: true }); | ||
if (overwrite) await rm(outputFile, { force: true }); | ||
await $`solana program dump ${id} ${outputFile}`; | ||
console.log(`Program ${id} dumped to ${outputFile}`); | ||
} catch (error) { | ||
console.error(`Error dumping ${id}: ${error.message}`) | ||
console.error(`Error dumping ${id}: ${error.message}`); | ||
} | ||
} | ||
} catch (error) { | ||
console.error(`Error preparing programs: ${error.message}`) | ||
console.error(`Error preparing programs: ${error.message}`); | ||
} |
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 |
---|---|---|
@@ -1,31 +1,34 @@ | ||
#!/usr/bin/env zx | ||
|
||
import { $ } from 'zx' | ||
import { mkdir, rm } from 'node:fs/promises' | ||
import { join } from 'node:path' | ||
import { mkdir, rm } from 'node:fs/promises'; | ||
import { join } from 'node:path'; | ||
import { $ } from 'zx'; | ||
|
||
const programs = [{ | ||
id: 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s', | ||
name: 'token_metadata.so', | ||
}] | ||
const programs = [ | ||
{ | ||
id: 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s', | ||
name: 'token_metadata.so', | ||
}, | ||
]; | ||
|
||
const outputDir = 'tests/fixtures' | ||
const overwrite = true | ||
const outputDir = 'tests/fixtures'; | ||
const overwrite = true; | ||
|
||
try { | ||
for (const program of programs) { | ||
const { id, name } = program; | ||
const outputFile = join(outputDir, name) | ||
const outputFile = join(outputDir, name); | ||
await $`solana config set -um`; | ||
|
||
try { | ||
await mkdir(outputDir, { recursive: true }) | ||
if (overwrite) await rm(outputFile, { force: true }) | ||
await $`solana program dump ${id} ${outputFile}` | ||
console.log(`Program ${id} dumped to ${outputFile}`) | ||
await mkdir(outputDir, { recursive: true }); | ||
if (overwrite) await rm(outputFile, { force: true }); | ||
await $`solana program dump ${id} ${outputFile}`; | ||
console.log(`Program ${id} dumped to ${outputFile}`); | ||
} catch (error) { | ||
console.error(`Error dumping ${id}: ${error.message}`) | ||
console.error(`Error dumping ${id}: ${error.message}`); | ||
} | ||
} | ||
} catch (error) { | ||
console.error(`Error preparing programs: ${error.message}`) | ||
console.error(`Error preparing programs: ${error.message}`); | ||
} |
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
Oops, something went wrong.