Skip to content

Commit

Permalink
Attempt to disable auto crlf in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
CarterGrimmeisen committed Jan 25, 2022
1 parent 6468f01 commit ca5ccb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- name: Disable Auto CRLF
run: git config --global core.autocrlf false

- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: 'npm'
cache: 'yarn'

- name: Install deps (no cache)
- name: Install deps
run: yarn install --frozen-lockfile

- name: Build
Expand Down
8 changes: 5 additions & 3 deletions src/util.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { DMMF } from '@prisma/generator-helper'
import type { CodeBlockWriter } from 'ts-morph'
import { Config } from './config'
import { sep } from 'path'

export const writeArray = (writer: CodeBlockWriter, array: string[], newLine = true) =>
array.forEach((line) => writer.write(line).conditionalNewLine(newLine))
Expand Down Expand Up @@ -34,9 +35,10 @@ export const chunk = <T extends any[]>(input: T, size: number): T[] => {
}

export const dotSlash = (path: string) => {
if (path.includes('/node_modules/')) return path.split('/node_modules/').slice(-1)[0]
if (path.includes(`${sep}node_modules${sep}`))
return path.split(`${sep}node_modules${sep}`).slice(-1)[0]

if (path.startsWith('../')) return path
if (path.startsWith(`..${sep}`)) return path

return './' + path
return `.${sep}${path}`
}

0 comments on commit ca5ccb3

Please sign in to comment.