WIP
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { bashRunAndReturnSync } from "./bashUtils"
|
||||
import { makeJJlogger } from "./jjLogger"
|
||||
|
||||
const logger = makeJJlogger({
|
||||
filename: 'helpers/gitSubRepoUtils.ts'
|
||||
})
|
||||
|
||||
|
||||
export const subRepositoryClean = async (subRepoRelPath) => {
|
||||
const repo = `${process.env.JJ_WORKSPACE_DIR}/${subRepoRelPath}`
|
||||
logger.log(`clean repository ${repo} start`)
|
||||
const command = `
|
||||
pushd "${repo}" > /dev/null
|
||||
git stash --include-untracked || true
|
||||
git clean -f -X -e ".~envFormat" -e ".~jsonFormat" -e ".~shellFormat" || true
|
||||
git clean -f -x -e ".~envFormat" -e ".~jsonFormat" -e ".~shellFormat" || true
|
||||
git clean -xdf -e ".~envFormat" -e ".~jsonFormat" -e ".~shellFormat" || true
|
||||
git reset --hard || true
|
||||
|
||||
popd > /dev/null
|
||||
`
|
||||
const res = await bashRunAndReturnSync({
|
||||
command: ""
|
||||
})
|
||||
|
||||
logger.log(res)
|
||||
logger.success(`clean repository ${repo} done`)
|
||||
}
|
||||
Reference in New Issue
Block a user