File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
apps/generator-cli/src/app/services Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import * as path from 'path';
66import * as fs from 'fs-extra' ;
77import * as glob from 'glob' ;
88import * as chalk from 'chalk' ;
9+ import * as os from 'os' ;
910import { VersionManagerService } from './version-manager.service' ;
1011import { ConfigService } from './config.service' ;
1112import { LOGGER } from '../constants' ;
@@ -173,9 +174,12 @@ export class GeneratorService {
173174
174175 if ( this . configService . useDocker ) {
175176 const volumes = Object . entries ( dockerVolumes ) . map ( ( [ k , v ] ) => `-v "${ v } :${ k } "` ) . join ( ' ' ) ;
177+ const userInfo = os . userInfo ( ) ;
178+ const userArg = userInfo . uid !== - 1 ? `--user ${ userInfo . uid } :${ userInfo . gid } ` : `` ;
176179
177180 return [
178181 `docker run --rm` ,
182+ userArg ,
179183 volumes ,
180184 this . versionManager . getDockerImageName ( ) ,
181185 'generate' ,
You can’t perform that action at this time.
0 commit comments