-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
1 parent
1e58419
commit 201e63f
Showing
8 changed files
with
617 additions
and
502 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// @ts-check | ||
|
||
/** @type {import("syncpack").RcFile} */ | ||
const config = { | ||
versionGroups: [ | ||
{ | ||
dependencies: ['@types/node'], | ||
packages: ['**'], | ||
pinVersion: '18.16.19', | ||
}, | ||
{ | ||
dependencies: ['chalk'], | ||
packages: ['**'], | ||
pinVersion: '4.1.2', | ||
}, | ||
{ | ||
dependencies: ['globby'], | ||
packages: ['**'], | ||
pinVersion: '11.1.0', | ||
}, | ||
{ | ||
dependencies: ['pretty-bytes'], | ||
packages: ['**'], | ||
pinVersion: '5.6.0', | ||
}, | ||
], | ||
}; | ||
|
||
module.exports = config; |
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,6 @@ | ||
import { exec as execProcess } from 'child_process'; | ||
import { promisify } from 'util'; | ||
|
||
const execProm = promisify(execProcess); | ||
|
||
export const exec = (program: string, args: string[]) => execProm(`${program} ${args.join(' ')}`); |
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,7 +1,4 @@ | ||
import execa from 'execa'; | ||
import { exec } from './exec'; | ||
|
||
export const osascript = (filePath: string, ...args: string[]): Promise<string> => | ||
execa('osascript', [filePath, ...args]).then(({ stdout }) => stdout); | ||
|
||
export const osascriptSync = (filePath: string, ...args: string[]): string => | ||
execa.sync('osascript', [filePath, ...args]).stdout; | ||
exec('osascript', [filePath, ...args]).then(({ stdout }) => stdout); |
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,14 +1,14 @@ | ||
import execa from 'execa'; | ||
import { pathExists } from './fs'; | ||
import { AppRunner } from '.'; | ||
import { IMAGEOPTIM, IMAGEOPTIM_BIN_PATH, IMAGEOPTIM_URL } from './constants'; | ||
import { info, panic, verbose } from './log'; | ||
import { exec } from './exec'; | ||
|
||
export const runImageOptim: AppRunner = async (options) => { | ||
info(`Running ${IMAGEOPTIM.name}...`); | ||
if (!(await pathExists(IMAGEOPTIM_BIN_PATH))) { | ||
return panic(`ImageOptim.app is not installed (${IMAGEOPTIM_URL})`, options); | ||
} | ||
await execa(IMAGEOPTIM_BIN_PATH, [options.tmpDir]); | ||
await exec(`${IMAGEOPTIM_BIN_PATH}`, [options.tmpDir]); | ||
verbose(`${IMAGEOPTIM.name} has finished`); | ||
}; |
Oops, something went wrong.