File tree Expand file tree Collapse file tree 5 files changed +27
-12
lines changed
Expand file tree Collapse file tree 5 files changed +27
-12
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- if [[ " $* " == * " --node" * ]]; then
4- /usr/bin/env node cli/main.js -- " $@ "
5- elif command /usr/bin/env bun & > /dev/null; then
6- /usr/bin/env bun cli/main.js -- " $@ "
7- elif command /usr/bin/env node & > /dev/null; then
8- /usr/bin/env node cli/main.js -- " $@ "
3+ CC_MAIN_SCRIPT_PARTIAL=" cherry-cola/cli/main.js"
4+ DIRNAME=$( dirname " $0 " )
5+
6+ if [[ $DIRNAME == * node_modules/.bin ]]; then
7+ CC_MAIN_SCRIPT=" ${DIRNAME// .bin/ $CC_MAIN_SCRIPT_PARTIAL } "
8+ else
9+ CC_MAIN_SCRIPT=" ${DIRNAME} /main.js"
910fi
11+
12+ /usr/bin/env bun " $CC_MAIN_SCRIPT " -- " $@ "
13+
14+ # if [[ "$*" == *"--node"* ]]; then
15+ # /usr/bin/env node "$CC_MAIN_SCRIPT" -- "$@"
16+ # elif command /usr/bin/env bun &>/dev/null; then
17+ # /usr/bin/env bun "$CC_MAIN_SCRIPT" -- "$@"
18+ # elif command /usr/bin/env node &>/dev/null; then
19+ # /usr/bin/env node "$CC_MAIN_SCRIPT" -- "$@"
20+ # fi
Original file line number Diff line number Diff line change 1010
1111@media (prefers-color-scheme : dark) {
1212 .App {
13- background : # 211e1e ;
13+ background : # 222 ;
1414 color : # fff ;
1515 }
1616}
Original file line number Diff line number Diff line change 1212
1313@media (prefers-color-scheme : dark) {
1414 body {
15- background : # 211e1e ;
15+ background : # 222 ;
1616 color : # fff ;
1717 }
1818}
Original file line number Diff line number Diff line change 11import resolveFile from './resolve-file'
22import projectRoot , { resolve as resolveProjectRoot } from '../../utils/project-root'
3+ import moduleRoot , { resolve as resolveModuleRoot } from '../../utils/module-root'
34import { printWarning , messages as warningMessages } from '../../messages/warnings'
45
5- const packageJson = await ( Bun . file ( resolveProjectRoot ( 'package.json' ) ) as File & { json : ( ) => object } ) . json ( )
6+ const projectPackageJson = await ( Bun . file ( resolveProjectRoot ( 'package.json' ) ) as File & { json : ( ) => object } ) . json ( )
7+ const modulePackageJson = await ( Bun . file ( resolveModuleRoot ( 'package.json' ) ) as File & { json : ( ) => object } ) . json ( )
68
79export default function resolveImportFileSpecifier ( base : string , fileSpecifier : string ) {
810 if ( fileSpecifier . startsWith ( '#' ) ) {
9- if ( 'imports' in packageJson )
10- fileSpecifier = resolveProjectRoot ( packageJson . imports [ fileSpecifier ] )
11+ if ( 'imports' in projectPackageJson )
12+ fileSpecifier = resolveProjectRoot ( projectPackageJson . imports [ fileSpecifier ] )
13+ else if ( 'imports' in modulePackageJson )
14+ fileSpecifier = resolveModuleRoot ( modulePackageJson . imports [ fileSpecifier ] )
1115 else
1216 printWarning ( warningMessages . resolve . noImports , [ fileSpecifier ] )
1317 } else {
Original file line number Diff line number Diff line change @@ -5,5 +5,5 @@ process.env.APP_MODULE_PATH = findDirWith('package.json')
55export default process . env . APP_MODULE_PATH
66
77export function resolve ( ...filePath ) {
8- return path . join ( process . env . PROJECT_ROOT_PATH , ...filePath )
8+ return path . join ( process . env . APP_MODULE_PATH , ...filePath )
99}
You can’t perform that action at this time.
0 commit comments