Skip to content
This repository was archived by the owner on Jan 16, 2021. It is now read-only.

Commit 8f24c9c

Browse files
author
Pavan Kumar
committed
[new-clone] remove extraneous parameters in clone sample
1 parent 44d835b commit 8f24c9c

File tree

9 files changed

+12
-12
lines changed

9 files changed

+12
-12
lines changed

add_cmd_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func newAddCmdHarnessWithConfig(t testing.TB) (*Harness, *addCmd, error) {
5858
h, _ := newAddCmdHarness(t)
5959
h.makeEmptyRoot()
6060

61-
ensure.Nil(t, (&newCmd{}).cloneSampleCloudCode(h.env, &app{Name: "B"}, false, true))
61+
ensure.Nil(t, (&newCmd{}).cloneSampleCloudCode(h.env, true))
6262

6363
return h, &a, nil
6464
}
@@ -115,7 +115,7 @@ func newLegacyAddCmdHarnessWithConfig(t testing.TB) (*Harness, *addCmd, error) {
115115
h, _ := newAddCmdHarness(t)
116116
h.makeEmptyRoot()
117117

118-
ensure.Nil(t, (&newCmd{}).cloneSampleCloudCode(h.env, &app{Name: "B"}, false, true))
118+
ensure.Nil(t, (&newCmd{}).cloneSampleCloudCode(h.env, true))
119119
ensure.Nil(t, os.MkdirAll(filepath.Join(h.env.Root, configDir), 0755))
120120
ensure.Nil(t,
121121
ioutil.WriteFile(

config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func TestConfigFromDirFormatType(t *testing.T) {
2727
h.makeEmptyRoot()
2828
defer h.Stop()
2929

30-
ensure.Nil(t, (&newCmd{}).cloneSampleCloudCode(h.env, &app{Name: "test"}, false, true))
30+
ensure.Nil(t, (&newCmd{}).cloneSampleCloudCode(h.env, true))
3131

3232
c, err := configFromDir(h.env.Root)
3333
ensure.Nil(t, err)

configure_cmd_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func TestProjectType(t *testing.T) {
125125
defer h.Stop()
126126

127127
h.makeEmptyRoot()
128-
ensure.Nil(t, (&newCmd{}).cloneSampleCloudCode(h.env, &app{Name: "test"}, false, false))
128+
ensure.Nil(t, (&newCmd{}).cloneSampleCloudCode(h.env, false))
129129

130130
c := &configureCmd{}
131131
err := c.projectType(h.env, []string{"1", "2"})

default_cmd_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func newDefaultCmdHarness(t testing.TB) (*Harness, *defaultCmd, *parseConfig) {
2727
h := newHarness(t)
2828
h.makeEmptyRoot()
2929

30-
ensure.Nil(t, (&newCmd{}).cloneSampleCloudCode(h.env, &app{Name: "test"}, false, true))
30+
ensure.Nil(t, (&newCmd{}).cloneSampleCloudCode(h.env, true))
3131

3232
config := newDefaultParseConfig(t, h)
3333
h.Out.Reset()
@@ -97,7 +97,7 @@ func newLegacyDefaultCmdHarness(t testing.TB) (*Harness, *defaultCmd, *parseConf
9797
h := newHarness(t)
9898
h.makeEmptyRoot()
9999

100-
ensure.Nil(t, (&newCmd{}).cloneSampleCloudCode(h.env, &app{Name: "test"}, false, true))
100+
ensure.Nil(t, (&newCmd{}).cloneSampleCloudCode(h.env, true))
101101
ensure.Nil(t, os.MkdirAll(filepath.Join(h.env.Root, configDir), 0755))
102102
ensure.Nil(t, ioutil.WriteFile(filepath.Join(h.env.Root, legacyConfigFile),
103103
[]byte("{}"),

jssdk_cmd_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func newJsSdkHarnessWithConfig(t testing.TB) (*Harness, *context) {
4444
h := newJsSdkHarness(t)
4545
h.makeEmptyRoot()
4646

47-
ensure.Nil(t, (&newCmd{}).cloneSampleCloudCode(h.env, &app{Name: "test"}, false, true))
47+
ensure.Nil(t, (&newCmd{}).cloneSampleCloudCode(h.env, true))
4848
h.Out.Reset()
4949

5050
c, err := configFromDir(h.env.Root)

list_cmd_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ func TestPrintListNoApps(t *testing.T) {
6767
h.makeEmptyRoot()
6868
defer h.Stop()
6969
n := &newCmd{}
70-
n.cloneSampleCloudCode(h.env, &app{Name: "test"}, false, true)
70+
n.cloneSampleCloudCode(h.env, true)
7171
ensure.Nil(t, l.printListOfApps(h.env))
7272
}

new.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ This will download Cloud Code to a temporary location.
237237
}
238238
}
239239
dumpTemplate = (isNew || dumpTemplate) && !n.noCode
240-
return dumpTemplate, n.cloneSampleCloudCode(e, app, isNew, dumpTemplate)
240+
return dumpTemplate, n.cloneSampleCloudCode(e, dumpTemplate)
241241
}
242242
return false, stackerr.Newf("Unknown project type: %d", e.Type)
243243
}

new_cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/facebookgo/stackerr"
99
)
1010

11-
func (n *newCmd) cloneSampleCloudCode(e *env, app *app, isNew bool, dumpTemplate bool) error {
11+
func (n *newCmd) cloneSampleCloudCode(e *env, dumpTemplate bool) error {
1212
err := os.MkdirAll(e.Root, 0755)
1313
if err != nil {
1414
return stackerr.Wrap(err)

new_cmd_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func TestNewCmdDirs(t *testing.T) {
2424
h, n := newNewCmdHarness(t)
2525
defer h.Stop()
2626

27-
ensure.Nil(t, n.cloneSampleCloudCode(h.env, &app{Name: "test"}, false, true))
27+
ensure.Nil(t, n.cloneSampleCloudCode(h.env, true))
2828

2929
var err error
3030

@@ -40,7 +40,7 @@ func TestNewCmdContent(t *testing.T) {
4040
h, n := newNewCmdHarness(t)
4141
defer h.Stop()
4242

43-
ensure.Nil(t, n.cloneSampleCloudCode(h.env, &app{Name: "test"}, false, true))
43+
ensure.Nil(t, n.cloneSampleCloudCode(h.env, true))
4444

4545
for _, newProjectFile := range newProjectFiles {
4646
content, err := ioutil.ReadFile(

0 commit comments

Comments
 (0)