Unverified Commit 19d0015b authored by Daniel Hochman's avatar Daniel Hochman Committed by GitHub
Browse files

scaffolding: fix copy when ~ is in path (#1637)

parent 34469695
yarn12211 FixCordonNotes GA4 RHF add-capacity-info add-list-pr-gh-api add-origin add-tabledetails-notes addCaseInsensitiveAutocomplete addSgTimeout addTimeoutForSG allIcons appProviderRewrite attempt-pure-css-wrap auditAPI auditBE auditFE autoSubmit autoSubmitResolvers autocomplete-clear-value aws-multi-account aws-multi-account-final-cutover aws-multi-account-gen-clients aws-multi-account-protos base64GH blogNits callbackToSetIndex caseInsens1 catalog-config-extension catalog-ql-patch cfgExtends changeGridLines chaos_server-fault-enable-greater-precision chartTests clearMocks clickAutocomplete codecov colorsFile compose-duplicate-test custom-title-logo customHookForTimelinePleaseWork darkModeTest1 dashLayout dashLoadedCheck datetimevalid ddb-fe ddb-panic-fix ddb-refactor ddb-refactor-endpoint ddb-response-proto ddb-scale-factor-fix ddb-updategsicapacity ddb-updatetable deletePodLocationNotes dialogCSS direct-client docshousekeeping dotenv downloadConfigEnvoy dschaller-patch-1 dschaller-patch-2 dschaller-patch-3 dynamodb-panic-fix dynamodb-status-chips dynamodb-update-more-logs dynamodb-wz-1 emojiSupport enable-partial-failures-for-pods envoy-cp-update envoyTriageViaK8sDash errorBoundaryLocation eslintdocs expSimplification exportEmotionThings expose-k8s-clientsets feedbackMaxLength first-of-type-fix firstgogogo fix-autocomplete-project-catalog fix-github-app-auth-refresh fixAlignOfIcons fixConfigTypes fixDASHSpacing fixDashSpacingPart1 fixwarning frontend-autocomplete-patch frontend-catalog-navigate-patch frontend-highlight-parent frontend-project-selector-patch frontend-warning-extension gcp-0.10.3 get-logs ghrl glangci-test go-1-18 go-1.19-in-ci go-actions-1-18 go-github-v38 golangci goworkspace graphql group-item-prefix header-adjustments hooksForAutoRefresh horizontalExpansion housekeepingclutch iam-custompolicy-sim iconButton iconButtonColors inputTransformers jest-coverage-fix jg/github jslaughter-patch-1 k8sDashAutosubmit license-update linkCSS load-state-error lowercaseAutocomplete main matv5 matv5-base matv5-core matv5-core-input matv5-core-layout matv5-joined matv5-wizard matv5-workflows metrics-blog metricsAPI metricsProtos mikecutalo-patch-1 minimistClutch moarTests moartests mockProjects mui-5-upgrade mui-v5 mui-v5-codemods mui-v5-core mui5 muiv5-upgrade murki-patch-1 nodeNameInCordonNode nonexistantProjects nps-anytime nps-collector nps-custom-patch openSourceReactMarkdownPane otherEventTimes override-search paperMinWidth pcDefaultProjects pcResetState pcSearch pcSubtext pd-info-project-proto persistProjects preflight-check-script project-api-mocks project-api-optional-compute-deps project-catalog project-catalog-config-patch project-catalog-config-skeleton project-catalog-details project-catalog-scaffold project-selector-autocomplete project-selector-testing project404 proto-get-endpoint protoForDeploys qLinks1 qLinksF qLinksForProjSelector quickLinks1 quicklinks1 reactHookForm refreshDropdown registrarEmptyRoutes relativeCfgDir reloadIntervalForProjSelector remove-utm-params removeBottomFeedbackButton removeIcon renderTestTimeseriesChart renovate-patch renovate/actions-setup-node-3.x renovate/actions-stale-6.x renovate/actions-upload-artifact-3.x renovate/babel-monorepo renovate/cypress-10.x renovate/cypress-8.x renovate/cypress-9.x renovate/docker-build-push-action-2.x renovate/docker-build-push-action-3.x renovate/docker-login-action-2.x renovate/docker-setup-buildx-action-2.x renovate/esbuild-0.x renovate/eslint-config-airbnb-19.x renovate/eslint-plugin-jest-25.x renovate/eslint-plugin-jest-26.x renovate/eslint-plugin-prettier-4.x renovate/font-awesome renovate/github.com-aws-aws-sdk-go-v2-1.x renovate/github.com-aws-aws-sdk-go-v2-config-1.x renovate/github.com-aws-aws-sdk-go-v2-credentials-1.x renovate/github.com-aws-aws-sdk-go-v2-service-autoscaling-1.x renovate/github.com-aws-aws-sdk-go-v2-service-kinesis-1.x renovate/github.com-aws-aws-sdk-go-v2-service-s3-1.x renovate/github.com-aws-smithy-go-1.x renovate/github.com-bradleyfalzon-ghinstallation-2.x renovate/github.com-bufbuild-buf-0.x renovate/github.com-bufbuild-buf-1.x renovate/github.com-coreos-go-oidc-v3-3.x renovate/github.com-envoyproxy-go-control-plane-0.x renovate/github.com-envoyproxy-protoc-gen-validate-0.x renovate/github.com-fullstorydev-grpcurl-1.x renovate/github.com-gogo-status-1.x renovate/github.com-golang-migrate-migrate-v4-4.x renovate/github.com-google-go-github-v37-38.x renovate/github.com-grpc-ecosystem-grpc-gateway-v2-2.x renovate/github.com-jhump-protoreflect-1.x renovate/github.com-lib-pq-1.x renovate/github.com-masterminds-squirrel-1.x renovate/github.com-shurcool-githubv4-digest renovate/github.com-shurcool-graphql-digest renovate/github.com-slack-go-slack-0.x renovate/github.com-stretchr-testify-1.x renovate/github.com-uber-go-tally-v4-4.x renovate/github.com-yoheimuta-go-protoparser-v4-4.x renovate/go-1.x renovate/go.temporal.io-sdk-1.x renovate/go.temporal.io-sdk-contrib-tally-0.x renovate/go.uber.org-zap-1.x renovate/golang-1.x renovate/golang.org-x-net-digest renovate/google.golang.org-genproto-digest renovate/google.golang.org-grpc-1.x renovate/google.golang.org-grpc-cmd-protoc-gen-go-grpc-1.x renovate/google.golang.org-protobuf-1.x renovate/hookform-devtools-3.x renovate/hookform-devtools-4.x renovate/hookform-resolvers-2.x renovate/k8s.io-api-0.x renovate/k8s.io-apimachinery-0.x renovate/k8s.io-client-go-0.x renovate/k8s.io-utils-digest renovate/kubernetes-go renovate/lock-file-maintenance renovate/major-1-kubernetes-go renovate/major-10-definitelytyped renovate/major-10-kubernetes-go renovate/major-11-kubernetes-go renovate/major-16-definitelytyped renovate/major-18-definitelytyped renovate/major-18-react-monorepo renovate/major-19-eslint renovate/major-2-kubernetes-go renovate/major-27-definitelytyped renovate/major-27-unittest renovate/major-28-definitelytyped renovate/major-28-unittest renovate/major-29-definitelytyped renovate/major-3-kubernetes-go renovate/major-4-eslint renovate/major-5-typescript-eslint-monorepo renovate/major-6-font-awesome renovate/major-8-eslint renovate/major-8-remark-monorepo renovate/material-table-1.x renovate/material-table-2.x renovate/nivo-monorepo renovate/node-16.x renovate/node-17.x renovate/node-18.x renovate/node-19.x renovate/npm-axios-vulnerability renovate/npm-prismjs-vulnerability renovate/npm-protobufjs-vulnerability renovate/postgres-14.x renovate/postgres-15.x renovate/react-hook-thunk-reducer-0.x renovate/react-scripts-5.x renovate/react-tiny-popover-7.x renovate/webpack-4.x renovate/webpack-dev-server-3.x renovate/webpack-dev-server-4.x renovateFix replaceNivoWithRechartsForEnvoy responsiveDash responsiveProjectSelector responsiveTable return-partial-errors revert-2270-addCaseInsensitiveAutocomplete revert-2348-timeago-patch s3accessdebugger-oss safetyCheckForAccounts scaffold-non-wizard scaffold-update scaffoldingYarn scatterPlotTimeline scrolling-menu select-grouping select-patch shortlink-protos shortlink-scaffolding shortlink-wip singleChoiceDrawer sl-bug-fix sl-patch slowloris smonero-patch-1 sourcegraph-impl sourcegraph-service spacingAdjustment sperry-CreateFeedback-proto sperry-GetFeedbackQuestions-proto sperry-SubmitFeedback-API sperry-add-GetSurveys-module sperry-add-emojis sperry-add-prop sperry-autocomplete-fix-experimentations sperry-card-header sperry-card-loading-prop sperry-cardcontent-paddingprop sperry-cards-fullWidth sperry-collapse-bttn sperry-core-tooltip sperry-enableFeedback-prop sperry-extend-type sperry-feedback-config sperry-feedback-docs sperry-globally-enable-wizard sperry-incremental-dash-updates sperry-project-links-proto sperry-project-selector-autocomplete sperry-proxy-module-host-header sperry-query-params sperry-remove-npswizard-featureflag sperry-resize-hpa-notes sperry-see-more-card-action sperry-stats-prefix sperry-update-card-header-design sperry-update-package state-hydration state-hydration-alerts state-hydration-selector state-hydration-short-links state-hydration-storage strictDash supportStylingOfCharts tableCSS tablecss temporal-client tfAdornment themeProvider timeSelectorHooks timeSeriesProto timeago-component todosPublic toggleButtonGroup toggleTest transientProps trimPrefixForAWS typographyNoWrap typographyStory typographyfix update-air-tool update-card-styling update-golangci-lint-1-42-1 update-kind-tool updatePodEventProto userGroups validate-pattern-at-runtime webicon wrapper2 wrapperForTimeSeries wrapperForTimeSeries2
No related merge requests found
Showing with 9 additions and 0 deletions
+9 -0
......@@ -270,6 +270,15 @@ func main() {
os.Exit(1)
}
// Fix tilde HOME path.
if strings.HasPrefix(dest, "~/") {
homeUser, err := user.Current()
if err != nil {
log.Fatal("could not get user's information", err)
}
dest = filepath.Join(homeUser.HomeDir, dest[2:])
}
// Check if dest exists.
if _, err := os.Stat(dest); !os.IsNotExist(err) {
log.Fatal("ERROR destination folder exists")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment